Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting sub category count
Message
From
07/02/2016 00:38:09
 
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:
01631024
Views:
39
>Can you post the structure of the table(s) involved here to determine when category has subcategories?

Category table

Numero Primary key
Title Character(20)
NoCategory Category primary key

So, basically, this is recursive inside the same table.

So, an unlimited number of categories can have parents and so on.

For most of them, Category.NoCategory is 0 so that denotes a parent. That is the highest hierarchy.

Then, for those records having a value in Category.NoCategory, it means they are child records of the parent. The parent can also be a child of another parent.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform