Basically my table Itinerary table where a record can have a parent record.
so table cound have
ID
Parent ID which can be any ID from The same table.
Other details
Parent ID can be null if the record doesn't have child.
and if i delete the parent record of a record then the child record will not link to the parent.
Is there a way to look for the records which dont have a parent?
want to see all the records which have a PID then check if the PID exists as ID in the same table I want to do this in one query
sample table
ID PID Discription
1 NULL something
2 1 something
3 4 something
5 3 something
6 NULL something
so from the above table i want to select ID 3 as it has a PID and the PID doesnt exists as ID
Thanks for your help in advance