Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting sub category count
Message
De
07/02/2016 00:38:09
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2014
OS:
Windows 8.1
Network:
Windows 2008 Server
Divers
Thread ID:
01631008
Message ID:
01631024
Vues:
38
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform