Google App Engine MySQL错误1064:语法错误

时间:2018-11-01 08:42:27

标签: mysql google-app-engine

我正在尝试运行此查询,但在Google App Engine(MySQL第2代v5.7)中不起作用。它向我显示语法错误。我不明白为什么它不起作用,因为在PHPMyAdmin(Mysql v5.7)中一切正常。

这是我的查询

SET @row_num := 0;
SELECT row_number
FROM (SELECT @row_num := @row_num + 1 as row_number, id FROM users ORDER BY id LIMIT 0, ?) result
WHERE result.id = ? LIMIT 1

错误:

Error 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 'SELECT row_number FROM (SELECT @row_num := @row_num + 1 as row_number, id FROM' at line 2

0 个答案:

没有答案