SQL subquery invalid in the select list -


i working on below code recursively same table getting error

*column 'checkinout.userid' invalid in select list because not contained in either aggregate function or group clause.*

*column 'checkinout.checktime' invalid in select list because not contained in either aggregate function or group clause.*

select convert(varchar,checktime, 106) gatedate, convert(varchar,checktime, 106) gatein ,(     select top 1 convert(varchar(5),ch001.checktime, 108)      checkinout ch001     checktype ='i'          , ch001.userid= mm001.userid            ,          (convert(varchar, ch001.checktime, 112) =convert(varchar, mm001.checktime, 112)) ) timein   checkinout mm001 userid=@empid 

select convert(varchar,checktime, 106) gatedate, convert(varchar,checktime, 106) gatein ,(     select top 1 convert(varchar(5),ch001.checktime, 108)      checkinout ch001     checktype ='i'          , ch001.userid= mm001.userid            ,          (convert(varchar, ch001.checktime, 112) =convert(varchar, mm001.checktime, 112)) ) timein   checkinout mm001 userid=@empid group checkinout.userid, checkinout.checktime 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

xcode - Swift Playground - Files are not readable -

jboss7.x - JBoss AS 7.3 vs 7.4 and differences -