ya we can use Except which is similar to NotIn
EXCEPT operator returns all distinct rows from left hand side table which does not exist in right hand side table. On the other hand "NOT IN" will return all rows from left hand side table which are not present in right hand side table but it will not remove duplicate rows from the result
EXCEPT
Run query with EXCEPT operator, Only distinct rows will return
Select id,name from Dept1
except
Select id,name from Dept2
NOTIN
Run query with NOT IN operator, duplicate rows will exist in the result
Select distinct id,name from Dept1
Where id not in
(Select id from Dept2 )
Thanks and Regards
V.SaratChand
Show difficulties that how difficult you are
Kavi.Sirius, if this helps please login to Mark As Answer. | Alert Moderator