<tfoot id='ArOVv'></tfoot>

  1. <small id='ArOVv'></small><noframes id='ArOVv'>

    • <bdo id='ArOVv'></bdo><ul id='ArOVv'></ul>
    <legend id='ArOVv'><style id='ArOVv'><dir id='ArOVv'><q id='ArOVv'></q></dir></style></legend>

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

      MySQL - 在 WHERE 子句中使用 COUNT(*)

      MySQL - Using COUNT(*) in the WHERE clause(MySQL - 在 WHERE 子句中使用 COUNT(*))

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

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

                <tbody id='Zn7RA'></tbody>
              <legend id='Zn7RA'><style id='Zn7RA'><dir id='Zn7RA'><q id='Zn7RA'></q></dir></style></legend>
              • <bdo id='Zn7RA'></bdo><ul id='Zn7RA'></ul>

              • 本文介绍了MySQL - 在 WHERE 子句中使用 COUNT(*)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在尝试在 MySQL 中完成以下操作(请参阅 pseudo 代码)

                I am trying to accomplish the following in MySQL (see pseudo code)

                SELECT DISTINCT gid
                FROM `gd`
                WHERE COUNT(*) > 10
                ORDER BY lastupdated DESC
                

                有没有办法在 WHERE 子句中不使用 (SELECT...) 来做到这一点,因为这看起来像是在浪费资源.

                Is there a way to do this without using a (SELECT...) in the WHERE clause because that would seem like a waste of resources.

                推荐答案

                试试这个;

                select gid
                from `gd`
                group by gid 
                having count(*) > 10
                order by lastupdated desc
                

                这篇关于MySQL - 在 WHERE 子句中使用 COUNT(*)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                Bogus foreign key constraint fail(虚假外键约束失败)
                how to get last insert id after insert query in codeigniter active record(如何在codeigniter活动记录中插入查询后获取最后一个插入ID)
                Force InnoDB to recheck foreign keys on a table/tables?(强制 InnoDB 重新检查表/表上的外键?)
                How to auto generate migrations with Sequelize CLI from Sequelize models?(如何使用 Sequelize CLI 从 Sequelize 模型自动生成迁移?)
                Clear MySQL query cache without restarting server(无需重启服务器即可清除 MySQL 查询缓存)
                ALTER TABLE to add a composite primary key(ALTER TABLE 添加复合主键)
                <legend id='X0vGu'><style id='X0vGu'><dir id='X0vGu'><q id='X0vGu'></q></dir></style></legend>
                  <tfoot id='X0vGu'></tfoot>

                        <tbody id='X0vGu'></tbody>

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

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

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