Re: select all fields plus total children

2005-03-17 Thread mos
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

Re: select all fields plus total children

2005-03-17 Thread SGreen
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: >

select all fields plus total children

2005-03-17 Thread brian ally
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