Posted by: anarchy99 June 30, 2019
Need help on Sql query
Login in to Rate this Post:     0       ?        
not optimized...

SELECT * FROM phonesTable pt1
WHERE pt1.EmployeeStatus = 'Employee'
AND pt1.MemberName IN (select pt2.MotherName from phonesTable pt2 where pt2.EmployeeStatus = 'Employee')
AND pt1.MemberName NOT IN (select pt3.MotherName from phonesTable pt3 where pt3.EmployeeStatus = 'Unemployee');
Read Full Discussion Thread for this article