View Single Post

   
  #9 (permalink)  
Old 02-28-2008, 09:46 AM
subtenante
 
Posts: n/a
Default Re: how many of a kind

On Thu, 10 May 2007 08:21:09 +0200, Stefano Perna <ajajajajai@tin.it>
wrote:

>
>one further question:
>
>in the categories table, I've an "is_active" field.
>What if I want to SELECT only where is_active=1?
>
>How should be changed this?
>
>SELECT COUNT(product_name) FROM products GROUP BY cat_id ORDER BY cat_id
>
>Is it possible? Thanks!


Ask MySQL exactly how you asked us :

SELECT COUNT(product_name)
FROM products

where is_active=1

GROUP BY cat_id ORDER BY cat_id
Reply With Quote