python - gql 查询返回 BadQueryError : Parse Error

标签 python google-app-engine gql

这是我的 gql 代码:

data = db.GqlQuery("SELECT * FROM Playlist " + "WHERE tags = :1" + "ORDER BY :2", tag, order)

我得到这个错误:

BadQueryError:解析错误:在符号 BY 处不应有其他符号

有人知道我做错了什么吗?

感谢帮助 J

最佳答案

您似乎出于某种未知原因连接了 GQL 字符串并且遗漏了一个空格。尝试:

data = db.GqlQuery("SELECT * FROM Playlist WHERE tags = :1 ORDER BY :2", tag, order)

关于python - gql 查询返回 BadQueryError : Parse Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5612123/

相关文章:

python - 在ctypes中读取c函数返回的数组

java - 使用 Java 随机查询 Google App Engine 数据存储区实体

multithreading - 是否有适用于 Python 2.7 的 ereporter 版本

google-app-engine - 如何使用实体键在 GQL 中查询

python - AppEngine 中的 GQL 查询

python - 字符串排列。存储在数组中返回相同的排列集?

Python SSL 验证失败

python - 高效编辑距离

python - while 循环删除数据存储中的数据

python - 合并缓存的 GQL 查询而不是使用 IN