概述
原文在这里
http://drupal.stackexchange.com/questions/20705/count-results-in-views-using-aggregation
Yes, it is possible in Views 3 out of the box.
The idea is the same as in SQL aggregations. Lets see an example:
-
Edit your view and enable Views aggregations:
-
Remove default sort criteria.
- Add fields “Content: Type” and “Content: Nid”:
Select COUNT function for Content: Nid:
To see what happens just turn on checkbox “Show the SQL query” at global Views settings page.
SELECT node.type AS node_type, COUNT(node.nid) AS nid
FROM
{node} node
WHERE (( (node.status = '1') ))
GROUP BY node_type
LIMIT 10 OFFSET 0
So, we are grouping nodes by node_type and calculating count for this groups.
最后
以上就是无限舞蹈为你收集整理的在Drupal在统计记录的数量的全部内容,希望文章能够帮你解决在Drupal在统计记录的数量所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复