首先,我不是 SQL 专家,所以可能我遗漏了一些括号或其他一些愚蠢简单的东西;-)
谁能告诉我为什么这有效并返回 4 行:
SELECT ppa.products_id FROM products_propattributes ppa
WHERE ( (options_id = "11" AND options_values_id = "18")
OR (options_id = "4" AND options_values_id = "4") )
而这个没有,虽然它应该匹配 1 行:
SELECT ppa.products_id FROM products_propattributes ppa
WHERE ( (options_id = "11" AND options_values_id = "18")
AND (options_id = "4" AND options_values_id = "4") )
任何帮助将不胜感激!提前致谢..
巴斯