SELECT * FROM table1, table2 WHERE table1.user_id = table2.id AND table1.content = news AND table1.content_id = 1
那不行.你不能在一个sql语句中有两个"AND"?
//托梅克
use*_*650 11
你可能想把'news'作为一个字符串引用...你也可能想要使用内连接(效率更高)
SELECT * FROM table1
INNER JOIN table2 ON table1.user_id = table2.id
WHERE table1.content = 'news'
AND table1.content_id = 1
Run Code Online (Sandbox Code Playgroud)