Johann[Gast] schrieb am 22.January.2009, 15:18:16 in der Kategorie pc.coding
mysql abfrage - verständnissproblem
> > SELECT DISTINCT products_id FROM products_attributes WHERE options_id > = 10 AND options_values_id = 41 AND options_id = 8 AND options_values_id = > 36
Was soll er denn da auch finden? Dein WHERE-Clause sagt: Gib mir einen Datensatz, dessen option_id=irgendwas etc. und gleichzeitig etwas anderes ist?
Das Stichwort heisst in Deinem Falle: OR
Probiere ob
SELECT DISTINCT products_id FROM products_attributes WHERE (options_id = 10 AND options_values_id = 41) OR (options_id = 8 AND options_values_id = 36);