House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / ColdFusion Talk (CF-Talk)

How many products in a specific category?

Author:
Leigh
12/21/2011 12:45 PM

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    


Search cf-talk

May 24, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference