<bdo id='XkKHY'></bdo><ul id='XkKHY'></ul>

    <tfoot id='XkKHY'></tfoot>

    <small id='XkKHY'></small><noframes id='XkKHY'>

  1. <i id='XkKHY'><tr id='XkKHY'><dt id='XkKHY'><q id='XkKHY'><span id='XkKHY'><b id='XkKHY'><form id='XkKHY'><ins id='XkKHY'></ins><ul id='XkKHY'></ul><sub id='XkKHY'></sub></form><legend id='XkKHY'></legend><bdo id='XkKHY'><pre id='XkKHY'><center id='XkKHY'></center></pre></bdo></b><th id='XkKHY'></th></span></q></dt></tr></i><div id='XkKHY'><tfoot id='XkKHY'></tfoot><dl id='XkKHY'><fieldset id='XkKHY'></fieldset></dl></div>

    <legend id='XkKHY'><style id='XkKHY'><dir id='XkKHY'><q id='XkKHY'></q></dir></style></legend>
    1. 计算视图中的结果数

      Count number of results in a View(计算视图中的结果数)
      <tfoot id='BjB12'></tfoot>
        <bdo id='BjB12'></bdo><ul id='BjB12'></ul>
      • <i id='BjB12'><tr id='BjB12'><dt id='BjB12'><q id='BjB12'><span id='BjB12'><b id='BjB12'><form id='BjB12'><ins id='BjB12'></ins><ul id='BjB12'></ul><sub id='BjB12'></sub></form><legend id='BjB12'></legend><bdo id='BjB12'><pre id='BjB12'><center id='BjB12'></center></pre></bdo></b><th id='BjB12'></th></span></q></dt></tr></i><div id='BjB12'><tfoot id='BjB12'></tfoot><dl id='BjB12'><fieldset id='BjB12'></fieldset></dl></div>

        <small id='BjB12'></small><noframes id='BjB12'>

          <legend id='BjB12'><style id='BjB12'><dir id='BjB12'><q id='BjB12'></q></dir></style></legend>
            <tbody id='BjB12'></tbody>

              1. 本文介绍了计算视图中的结果数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我需要计算有多少人属于预定义的组(这在 SQL 中使用 SELECT COUNT 语句很容易做到).我的视图查询运行良好并在我的表中显示实际数据,但我只需要知道它找到了多少结果.

                I need to count how many people belong in pre-defined groups (this is easy to do in SQL using the SELECT COUNT statement). My Views query runs fine and displays the actual data in my table, but I simply need to know how many results it found.

                但是,视图中似乎没有 COUNT 选项.我猜我将不得不使用某种视图挂钩,然后将结果粘贴到表格中.

                However there doesn't seem to be a COUNT option in views. I am guessing I am going to have to use some sort of views hook, and then stick the result in the table.

                这是我想要实现的目标的一个简单示例:

                Here's a quick example of what i'm trying to achieve:

                My Table
                ----------------------
                Group A | 20 people
                Group B | 63 people
                

                等等.

                (我已经尝试使用 Views_Calc 模块,但我收到错误,因为它还不是很稳定.)

                (I've tried using the Views_Calc module, but I get errors because it is not quite stable yet.)

                有人知道一种简单的方法来计算视图中的结果吗?

                Anybody know of an easy way to count results in Views?

                推荐答案

                这是一个很好的 d.o 主题:http://drupal.org/node/131031

                Here's a good d.o thread about it: http://drupal.org/node/131031

                尽管如果您只需要计数而不是 Views 提供的其他内容(字段格式和排序等),为什么不编写正确的 SELECT COUNT 语句并收工呢?

                Although if you JUST need the count and not the other things Views offers (field formatting & ordering, etc), why not just code up the proper SELECT COUNT statement and call it a day?

                (如果您确实需要 Views 提供的那些其他作品,上面有很多关于该线程的示例.)

                (If you DO in fact need those other pieces Views offers, there are many examples on that thread above.)

                这篇关于计算视图中的结果数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                How do I pass parameters into a PHP script through a webpage?(如何通过网页将参数传递给 PHP 脚本?)
                PHP - include a php file and also send query parameters(PHP - 包含一个 php 文件并发送查询参数)
                Where can I read about conditionals done with quot;?quot; and quot;:quot; (colon)?(我在哪里可以阅读有关使用“?完成的条件的信息?和“:(冒号)?)
                Accessing arrays whitout quoting the key(在不引用键的情况下访问数组)
                What is the name for the quot;lt;lt;lt;quot; operator?(“lt;lt;lt;的名字是什么?操作员?)
                default as first option in switch statement?(默认为 switch 语句中的第一个选项?)
                <legend id='PTJ54'><style id='PTJ54'><dir id='PTJ54'><q id='PTJ54'></q></dir></style></legend>

                    <small id='PTJ54'></small><noframes id='PTJ54'>

                        <bdo id='PTJ54'></bdo><ul id='PTJ54'></ul>
                        <i id='PTJ54'><tr id='PTJ54'><dt id='PTJ54'><q id='PTJ54'><span id='PTJ54'><b id='PTJ54'><form id='PTJ54'><ins id='PTJ54'></ins><ul id='PTJ54'></ul><sub id='PTJ54'></sub></form><legend id='PTJ54'></legend><bdo id='PTJ54'><pre id='PTJ54'><center id='PTJ54'></center></pre></bdo></b><th id='PTJ54'></th></span></q></dt></tr></i><div id='PTJ54'><tfoot id='PTJ54'></tfoot><dl id='PTJ54'><fieldset id='PTJ54'></fieldset></dl></div>

                          <tbody id='PTJ54'></tbody>
                          <tfoot id='PTJ54'></tfoot>