View Single Post

   
  #1 (permalink)  
Old 02-28-2008, 10:46 AM
Stefano Perna
 
Posts: n/a
Default how many of a kind


Hi, I'm a newbie,
so please be patient.

I've a table

product_name | cat_id

prod1 | 1
prod2 | 2
prod3 | 2
prod4 | 2
prod5 | 3
prod6 | 3
prod7 | 4
prod8 | 5
prod9 | 5
prodN | N

Is there any way to know how many 1s, 2s, Ns, etc. do we have in the
cat_id field or is this a middleware task? I'm not talking about the
DISTINCT: I want to know for every number in cat_id how many products do
we have.

Thanks!
Reply With Quote