BatchNo SID Status 2101 123 Finished 2101 457 Pending 2101 478 Finished 2101 8745 Finished 2102 4574 Finished 2102 4578 Finished 2102 4789 Finished 2103 6214 Finished 2103 4236 Pending 2103 7895 Pending
select distinct BatchNo from TABLE as x where ((select count(*) Status from TABLE where BatchNo = x.BatchNo) = (select count(*) Status from TABLE where BatchNo= x.BatchNo and Status = x.Status ))
select distinct BatchNo from groupdata where BatchNo not in (select BatchNo from groupdata where status = 'Pending')
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)