[Wolves] sql query ;-)

sparkes sparkes at westmids.biz
Mon Jun 21 23:25:23 BST 2004


The artist formally known as sparkes was heard to say...
>

answer my own question by asking another question
>
> "select count(*) as count, Category.CatID, Category.name from product left
> join Category on product.CatID = Category.CatID group by Category.CatID
> order by count desc"
>

"select count(*) as count, Category.CatID, Category.name from Category
left join product on product.CatID = Category.CatID group by
Category.CatID order by count desc"

makes more sense and returns all the categories but gives 1 for categories
that contain zero rows.  It doesn't add one to everything just those that
have zero entries.  How do I know if a category has one or zero entrys? 
Why does it give one and not zero.

sparkes - who needs to brush up his very rusty sql



More information about the Wolves mailing list