I have a table that looks like this:
It has products. Some are related to a parent product by a "Parent ID".
I need a query that will only select parent products that don't have any children related to it. Such as "Product-4".
Can anyone help me with this? It seems quite an easy solution.
select NAME from my_table where ID not in (select parent_ID from my_table)
should do it