如何从现有查询中获取不同的值

时间:2019-04-09 07:50:31

标签: sql-server-2017-express

SELECT * FROM [workflow_thread_progress_table] WHERE ([people]=@peopleType AND [complitionStatus]='FALSE' AND [isOpen]='TRUE' AND [isClosed]='FALSE' AND [peopleID]=@peopleID) OR ([people]=@peopleType AND [complitionStatus]='FALSE' AND [isOpen]='TRUE' AND [isClosed]='FALSE' AND [peopleID] in (Select [delegatedBy] from [User_Delegation_Table] where delegatedTo=@peopleID AND IsEnabled=1 AND Convert(varchar(30),[del_from],102)<=GETDATE() AND Convert(varchar(30),[del_to],102)>=GETDATE())) order by [SLNO] desc

此查询获取具有相同workFlowID的多条记录,但我希望具有相同workFlowID的单条记录

0 个答案:

没有答案