client type school a 1 123 a 2 123 b 1 123 b 2 123 c 1 123 d 2 123 e 3 123
select distinct client from table a join table b on b.client = a.client where a.type= '1' and b.type = '2'
SELECT T1.CLIENT FROM [YOUR_TBL] T1 INNER JOIN [YOUR_TBL] T2 ON T2.CLIENT = T1.CLIENT AND T2.TYPE <> 1 WHERE T1.TYPE = 1 AND T2.TYPE = 2
select client,type1 from school where (type1=1 or type1=2) and (client='a' or client='b');
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)