Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting sub category count
Message
 
 
To
06/02/2016 11:15:50
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2014
OS:
Windows 8.1
Network:
Windows 2008 Server
Miscellaneous
Thread ID:
01631008
Message ID:
01631021
Views:
47
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform