>I have a list of categories. Some of them have sub categories. When I select the categories, I need to include a count field which would indicate either 0, if there is no sub category for that category, or a count indicating how many sub categories that category has. I am looking for the most effective simple SQL syntax for that.
Can you post the structure of the table(s) involved here to determine when category has subcategories?
If it's not broken, fix it until it is.
My Blog