louissto56
Programmer
Hello. I have a recursion type application and need to count the category database including subcategorys.
It is setup like this:
catID - PK
catName - varchar
parentID - integer
For example:
Accomodation (catID = 1) is a top level category (parentID = 0).
Shared Houses is a sub category of accomodation (parentID = 1)
Hotels is a sub category of accomodation (parentID = 1)
Say I have 2 records in shared houses and 1 in hotels, how would I count it so Accomodation has a count value of 3?
Thanks
Louis
It is setup like this:
catID - PK
catName - varchar
parentID - integer
For example:
Accomodation (catID = 1) is a top level category (parentID = 0).
Shared Houses is a sub category of accomodation (parentID = 1)
Hotels is a sub category of accomodation (parentID = 1)
Say I have 2 records in shared houses and 1 in hotels, how would I count it so Accomodation has a count value of 3?
Thanks
Louis