Hi
I would like to know if the following can be done with one single query.
Let's say we have :
table_categories with columns cat_ID, cat_name
table_products with columns prod_ID, prod_cat_ID, prod_name
prod_cat_ID contains the category IDs for each product.
It can contain a single ID, BUT, it can contain mutliple IDs too ( commas separated in that case ).
Now, if I want to loop through all the categories and count the number of products found in every category like this :
T-shirts : 20 products
Sweats : 33 products
Hats : 22 products
....
How should I do with one query?
Thanks for the help!