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 * .

 

上一篇:因果推断-解决推荐系统公平性的新思路


下一篇:9灰色预测- 灰色模型GM(1,N)