我在Oracle
中编写了此代码,但将其放入MySQL
我收到错误。
SQL查询:文档
Select idan
From Certificare
Having count(idav)=3
Group by idan
LIMIT 0, 25
MySQL说:文档
#1064 - 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 by {idan}
LIMIT 0, 25' at line 4 strong text
答案 0 :(得分:2)
GROUP BY
在HAVING
之前发生,这就是您收到错误的原因。
答案 1 :(得分:0)
尝试此查询
Select `idan`
From `Certificare`
Group by `idan`
Having count(`idav`)=3
LIMIT 0, 25
GROUP BY
应该出现在Having