I have a table named Persons with the following data
The following query will fetch me the pid value in Persons table which is not equal to any of the PersonId values :
select B.pid
from Persons A
RIGHT JOIN Persons B ON (A.PersonID = B.pid)
where A.PersonID IS NULL
AND B.pid IS NOT NULL
Is there a way to fetch the same data using LEFT OUTER JOIN?