How to replace a NOT IN Query to a join?
Hi,
I have heard join queries are faster than NOT IN. Could anyone please help in converting the below query to a join query? Since, there is only one table, am not sure, if self- reference needs to be made.
Select id, name from department
where id NOT IN
*(Select id from department group by id having count(id)>1)*
order by id;Any help in this regard will be highly appreciated.
Thanks.