什么是GQL计数查询 [英] what is the GQL count query

查看:130
本文介绍了什么是GQL计数查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了时间的利益,我的意思是GQL,如

  SELECT * FROM Song WHERE composer ='Lennon, John'

以下失败

  SELECT COUNT(*)FROM myEntity 

也包含以下内容

  SELECT COUNT()FROM myEntity 


解决方案

如图所示 here ,实际上有一种方法来计算你的GQL的回报。有关GQL的文档语言显示您无法真正进行统计在查询本身。所以你要做的就是把你的select *放到一个GQL查询对象中,然后调用该对象上的count()方法来计数


In the interest of time, I do mean GQL, as in

SELECT * FROM Song WHERE composer = 'Lennon, John'

The following failed

SELECT COUNT(*) FROM myEntity

also the following

SELECT COUNT() FROM myEntity

解决方案

As shown here, there is actually a way to count the return of your GQL. The doc about the GQL language shows you can't really do a count on the query itself. So what you would do is take your select *, put it in a GQL query object, then call the "count()" method on that object to have the count

这篇关于什么是GQL计数查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆