我正在尝试使用IN中另一个字段的值。MySQL IN问题
SELECT types.id, title, auth_users.types
FROM types
LEFT JOIN auth_users ON auth_users.id IN (8,9)
WHERE types.id IN (1,2,3)
GROUP BY types.id
作品
SELECT types.id, title, auth_users.types
FROM types
LEFT JOIN auth_users ON auth_users.id IN (8,9)
WHERE types.id IN (auth_users.types)
GROUP BY types.id
不工作
http://pastebin.com/m76ae0596更多信息可以在这里
auth_users.types = 1,2,3
根据你的pastebin,你似乎在auth_users.types中存储逗号分隔的字符串。这是吗? auth_users.types ='1,2,3'。我强烈建议改变你的模式,如果是的话,试图加入这个领域是一个坏主意。 – hobodave 2009-07-26 09:09:17