At 01:28 PM 3/17/2005, you wrote:
I have 2 tables, category & product. product contains category_id which
points back to category.id
I'm trying to get all fields for each category plus the total no. of
products in that category. A simple query for this:
SELECT c.*, COUNT(p.id) AS total
FROM cat
brian ally <[EMAIL PROTECTED]> wrote on 03/17/2005 02:28:46 PM:
> I have 2 tables, category & product. product contains category_id which
> points back to category.id
>
> I'm trying to get all fields for each category plus the total no. of
> products in that category. A simple query for this:
>
I have 2 tables, category & product. product contains category_id which
points back to category.id
I'm trying to get all fields for each category plus the total no. of
products in that category. A simple query for this:
SELECT c.*, COUNT(p.id) AS total
FROM category AS c, product AS p
WHERE c.p