Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- Selecting items with another item in common


homeless - 10:37 am on Oct 26, 2008 (gmt 0)


1. Create [temporary] table new_table with fields CatID and Count
2. Insert into new_table (CatID, Count) select CatID, count(*) from prod_table Group by CatID
3. Delete from new_table where Count = '1'

I haven't tested this but this should get you all the CatID's that have a one-to-many relationship with pID


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/3773560.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com