Re: [SQL] determining how many products are in how many categories

2004-02-15 Thread Greg Patnude
You might be better off with something more like this: SELECT COUNT(P.*) AS p_count, P.p_product_category_id FROM p_product P WHERE P.p_product_category_id IN (SELECT DISTINCT id FROM p_product_category) GROUP BY P.p_product_category_id; obviously tailored to YOUR schema... not mine... -- Greg P

[SQL] determining how many products are in how many categories

2004-02-08 Thread David Garamond
# product table (simplified): create table p ( id char(22) not null primary key, name text, desc text ); # product category table (simpl.): create table pc ( id char(22) not null primary key, name text, desc text ); # table that maps products into categories: create table p_pc ( id ch