sql - top 1 case in select statement on TSQL -
i having problem on query. how can fix this:
select (select case top 1 status when 'inprocess' 'processing' when 'inworkbin' 'waiting in draft' end ics_email_connections_trx a.sessionid = b.sessionid , status <> 'completed' order a.create_date desc) last_status
i getting error:
incorrect syntax near keyword 'top'.
any suggestions?
try:
select top 1 case status
instead of
select case top 1 status
Comments
Post a Comment