RE: Query to return products given matches on attributes

2001-09-20 Thread Jason Clark
A book I've found very usefull is 'MySQL and mSQL' by O'Reilly You could use a query like this, but... select distinct item_number from Attributes where attribute like 'football' and value like 'nfl' You will be happier if you rethink your layout and create multiple tables. Give them unique

Re: Query to return products given matches on attributes

2001-09-20 Thread Adams, Bill TQO
Or: SELECT DISTINCT T1.item_number FROM Attributes t1, Attributes t2, Attributes t3 WHERE t1.item_number=t2.item_number AND t2.item_number=t3.item_number AND t1.attribute='sport' AND t1.value='football' AND t2.attribute='league' AND t2.value='nfl' AND t3.attribute='typeb' AND t3.value='jersey';