show only categories that have products in them
问题 excuse the bad title but I couldn't find a good way to express what I want in abstract terms. Anyway I have 3 tables tbl_product: PID | productname 1 | product 1 2 | product 2 3 | product 3 4 | product 4 .. tbl_categories, motherCategory allows me to nest categories: CID | categoriename | motherCategory 1 | electronics | NULL 2 | clothing | NULL 3 | Arduino | 1 4 | Casings, extra's | 3 .. tbl_productInCategory PID and CID are foreign keys to PID and CID in tbl_product and tbl_categories