首页 > 数据库> > Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: This ver
Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: This ver
作者:互联网
出现了这个错误,原因是内层select语句带有limit子句。
原来的sql为:
SELECT uid, open_acc_status, open_acc_time, mobile_num, email, reg_type FROM UserInfo WHERE uid IN (SELECT uid FROM InviteCode WHERE invite_uid = 100000004 LIMIT 1 OFFSET 1)
这样的sql语句存在sql语法错误,但是再加一层就行。如:
SELECT uid, open_acc_status, open_acc_time, mobile_num, email, reg_type FROM UserInfo WHERE uid IN (SELECT i.uid FROM (SELECT * FROM InviteCode WHERE invite_uid = 100000004 LIMIT 1 OFFSET 1) as i)
在最后的的from table改成 Select * .
标签:acc,jdbc,querying,uid,database,WHERE,LIMIT,open,SELECT 来源: https://www.cnblogs.com/yangzhixue/p/14154038.html