offerauto statusauto 1 2 2 2 2 3 2 10 3 2 3 7 3 10 4 2 4 10 5 10 ---------
select offerauto from myTable where statusauto in(2,10) group by offerauto having count(distinct statusauto)=2
SELECT * FROM TableName a, TableName b WHERE a.OfferAuto = b.OfferAuto AND a.StatusAuto = 2 AND b.StatusAuto = 10
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)