|
Mailing Lists
|
Home / Groups / ColdFusion Talk (CF-Talk)
How many products in a specific category?If you just want to display the number of products (not the details) a join would do it. Something like SELECT c.ID, c.CATEGORY, c.RANK, c.CATEGORY AS ID_Field, COUNT(p.ID) AS TotalProducts FROM Categories c LEFT JOIN Products p ON p.Category = c.Category GROUP BY c.ID, c.CATEGORY, c.RANK, c.CATEGORY |
May 24, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||