Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 GQL 在 GAE 数据存储中的表的特定列中找到最大值?
为了最大限度地使用 GQL,您可以这样做:
max_x = db.GqlQuery("SELECT * FROM MyModel ORDER BY x DESC").get().x
您可以使用这种语法上更短但等效的方法:
max_x = MyModel.all().order('-x').get().x