Select Count(PID) from ( SELECT PID FROM myTable WHERE EID = 7 group by PID having Min(Status)=Max(Status) and Min(Status) = 'Close' ) as SelectedData;
SELECT COUNT(ID) FROM myTable WHERE EID = 7 AND Status = 'Close'
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)