gpt4 book ai didi

mysql - 这个MySQL命令有什么问题?

转载 作者:太空宇宙 更新时间:2023-11-03 11:31:53 25 4
gpt4 key购买 nike

为我的 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 部分。但我不知道它有什么问题。

Click here to see that I have all the needed colums

谁能找出问题出在哪里?

最佳答案

group 是 SQL 中的保留字。你应该在它周围加上引号。一些 JPA 提供程序会自动执行此操作,而其他提供程序则不会...

关于mysql - 这个MySQL命令有什么问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49156002/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com