By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,400 Members | 1,021 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,400 IT Pros & Developers. It's quick & easy.

how can i search subcategory wise for a particular category,i want to display items

P: 1
how can i search subcategory wise for a particular category,i want to display items.suppose user selected a particular category.I want to display all items in that category + its subcategories.

this is my table structure with 3 tables.

i need a sql query

Oct 12 '06 #1
Share this Question
Share on Google+
1 Reply


P: 5
You may want to rethink your table structure, you appear to be allowing items to be cross-referenced with categories rather then belong to categories. This is only valid if you want an item to belong to more than one category, which hass a huge impact on your queries (an order of magnitude greater).

Normally, your table structure would be

Category

is parent to

Subcategory

is parent to

Item

in which case, once you had acquired the category for the item, you could then simply select all of the subcategories, and then all of the items in each subcategory of that category.
Oct 12 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.