我不知道为什么它不起作用。
"SELECT id GROUP_CONCAT(skill SEPARATOR ', ') FROM resume_skills GROUP BY id";
我有一张表resume_skills,然后有两个字段id和skill。 它返回一个像这样的错误:
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 'GROUP_CONCAT(skill SEPARATOR ', ') FROM resume_skills GROUP BY id' at line 1
我还没弄明白。帮助
答案 0 :(得分:5)
你错过了id和group之间的逗号(,)。
正确的查询:
SELECT id, GROUP_CONCAT(skill SEPARATOR ', ') FROM resume_skills GROUP BY id