I'm not sure I followed everything you said, but if products.productid is
NULL then I think you will only find those categories that have no matching
products in the products_categories table. Is that what you want?
Regards,
Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmi
The query you suggested with two tables is a great start.
If you make your query into an inline-view (which treats
a query like a table) you could now connect the categories
table to your suggested query:
SELECT
AA.categoryid,
AA.productid
FROM
(
SELECT
A.categoryid,
A.productid