gql 错误:BadQueryError:解析错误:符号处的 ORDER BY 属性无效:3
我收到此错误:
Parse Error: Invalid ORDER BY Property at symbol :3
无法查看导致该错误的原因,如果我删除替换并添加“日期”,它就可以工作。
order = "date"
playlists_data = db.GqlQuery('SELECT * FROM Playlist WHERE
client = :1 AND
category = :2
ORDER BY :3 DESC', client, category, order)
I'm getting this error:
Parse Error: Invalid ORDER BY Property at symbol :3
Can't see what is causing it, if I remove the substitution and add "date" it works.
order = "date"
playlists_data = db.GqlQuery('SELECT * FROM Playlist WHERE
client = :1 AND
category = :2
ORDER BY :3 DESC', client, category, order)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ORDER BY 不支持绑定参数。
它们只能用在 WHERE 子句中,并且只能替换属性值,不能替换属性名称。
ORDER BY doesn't support bound parameters.
They can only be used in a WHERE clause, and only to replace property values, not property names.