PicklistNo Status
PKL019000 LOD
PKL019000 LOD
PKL019000 LOD
PKL019000 LOD
PKL019000 WIP
If any status contain Wip it give no result.
I used query :-
Select DISTINCT PickListNo,status from tablename WHERE PickListNo='PKL019000' and Status='LOD'
It gives me result. But I dont want any row if any row status contain WIP
If any status contain Wip it give no result.
I used query :-
Select DISTINCT PickListNo,status from tablename WHERE PickListNo='PKL019000' and Status='LOD'
It gives me result. But I dont want any row if any row status contain WIP


Jignesh TrivediRank #16 · 50.3K reputationPosted Oct 28, 2013, 10:52 PM EDT
try following query
Select DISTINCT PickListNo,status from #tempTable1 p WHERE PickListNo='PKL019000'
and NOT EXISTS(select * from #tempTable1 where PickListNo = p.PickListNo and Status = 'WIP')
hope this will help you.
Ravi ShekharRank #673 · 3.6K reputationPosted Oct 29, 2013, 3:49 AM EDT
srinivas thummalapalli14 reputationPosted Oct 29, 2013, 5:07 AM EDT
Ravi ShekharRank #673 · 3.6K reputationPosted Oct 29, 2013, 7:45 PM EDT
Jignesh TrivediRank #16 · 50.3K reputationPosted Oct 29, 2013, 8:53 PM EDT