[GAE笔记]GQL参考
SELECT * FROM <kind>
[WHERE <condition> [AND <condition> ...]]
[ORDER BY <property> [ASC | DESC] [, <property> [ASC | DESC] ...]]
[LIMIT [<offset>,]<count>]
[OFFSET <offset>]
<condition> := <property> {< | <= | > | >= | = | != } <value>
<condition> := <property> IN <list>
<condition> := ANCESTOR IS <entity or key>
- 关键字大小写不敏感,类型与属性名是大小写敏感的。
- GQL只有select语句,返回的是一个或多个实例
- filed总是*,就是查询所有列。保留SQL的句法是习惯问题
- GQL查询不支持join语句
- 支持关键字AND,不支持OR.使用IN语句来部分实现OR的功能.
- 使用IN的时候,实际上是在后台运行了多条select语句,然后返回结果(结果中去除了重复数据).在一条语句中允许进行最多30个Datastore的查询
- 字符串中的转义字符是’,比如’Joe’’s Diner’
- LIMIT类似于TOP
-
OFFSET 2 结果集偏移两位
- 查询相关用户的列(userproperty) :SELECT * FROM Greeting WHERE author = USER(’hamainterATgmail.com’)
相关文章:
Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.





努力