I have a table, lets call it items, that has a few fields: id, parent, count and title. I've been trying to figure out how to select all items where parent = 0 and showing the number of 'children' under that item (items that has parent set to the current items id). I would also like to get the sum of all childrens count value.
I could easily do it with several queries, but I'd like to do it all in one. Any ideas? Is it possible?