这个 MySQL 查询有什么问题?
$result = mysql_query("SELECT did FROM publications where group IN
(SELECT s_group FROM subscriptions where uid1='$id')") or die(mysql_error());
我收到语法错误:
You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near 's_group FROM
subscriptions where uid1='34846')' at line 1
最佳答案
GROUP
是保留关键字。用 ` 括起来表示它是一个列名称:
SELECT did FROM publications where `group` IN
(SELECT s_group FROM subscriptions where uid1=1)
关于MySQL子查询语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21042118/