[英]What is wrong with this MySQL command?
為我的MySQL數據庫引發錯誤的查詢是:
SELECT t1.GROUPNAME FROM user_group t0, group t1 WHERE ((t0.users_USERNAME =
?) AND (t1.GROUPNAME = t0.groups_GROUPNAME))
錯誤信息如下:
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 t1 WHERE
((t0.users_USERNAME = 'test') AND (t1.GROUPNAME = t0.groups_GROUP')
好吧,我知道問題出在組t1部分。 但是我不知道這是怎么回事。
任何人都可以找出問題所在嗎?
group
是SQL中的保留字。 您應該在它周圍加上引號。 一些JPA提供程序會自動執行此操作,而其他JPA提供程序則不會...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.