Hi everybody!
I am storing a tree in a mySql DB. Essentially I have 2 colums: id and parentId
For example:
id parentId
1 0 //root
2 1
3 1
4 2
5 3
Is there an efficient query to get only those rows that have no children (in this case row with ids 4 and 5)