इसे आजमाएं:
select a.id from Table1 a
inner join Table1 b on a.uid = b.uid and b.dept = 'dept1';
डेमो:http://sqlfiddle.com/#!2/05774/4
इसे आजमाएं:
select a.id from Table1 a
inner join Table1 b on a.uid = b.uid and b.dept = 'dept1';
डेमो:http://sqlfiddle.com/#!2/05774/4