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

  • <tfoot id='Kzn8n'></tfoot>
      <bdo id='Kzn8n'></bdo><ul id='Kzn8n'></ul>

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

        <legend id='Kzn8n'><style id='Kzn8n'><dir id='Kzn8n'><q id='Kzn8n'></q></dir></style></legend>

        计算唯一值的数量

        Count number of unique values(计算唯一值的数量)

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

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

                <tbody id='C3Jn9'></tbody>
                  <i id='C3Jn9'><tr id='C3Jn9'><dt id='C3Jn9'><q id='C3Jn9'><span id='C3Jn9'><b id='C3Jn9'><form id='C3Jn9'><ins id='C3Jn9'></ins><ul id='C3Jn9'></ul><sub id='C3Jn9'></sub></form><legend id='C3Jn9'></legend><bdo id='C3Jn9'><pre id='C3Jn9'><center id='C3Jn9'></center></pre></bdo></b><th id='C3Jn9'></th></span></q></dt></tr></i><div id='C3Jn9'><tfoot id='C3Jn9'></tfoot><dl id='C3Jn9'><fieldset id='C3Jn9'></fieldset></dl></div>
                  本文介绍了计算唯一值的数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如果我有三列:

                  orderNumber, name, email
                  

                  我想计算表格中有多少独特的电子邮件,我该怎么做?

                  and I would like to count how many unique emails are in the table how would I go about doing so?

                  这样的声明:

                  SELECT count(email) FROM orders
                  

                  给我总数.

                  我试过SELECT DISTINCT count(email) FROM orders

                  但这似乎并没有给我我期望的数字.

                  but that does not seem to be giving me the numbers I am expecting.

                  推荐答案

                  使用

                  SELECT count( DISTINCT(email) ) FROM orders
                  

                  Distinct 提供唯一的电子邮件 ID,然后简单地对其进行计数.

                  Distinct provide unique email ids and then simply count them.

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

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

                  相关文档推荐

                  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 添加复合主键)
                    • <i id='rIhvr'><tr id='rIhvr'><dt id='rIhvr'><q id='rIhvr'><span id='rIhvr'><b id='rIhvr'><form id='rIhvr'><ins id='rIhvr'></ins><ul id='rIhvr'></ul><sub id='rIhvr'></sub></form><legend id='rIhvr'></legend><bdo id='rIhvr'><pre id='rIhvr'><center id='rIhvr'></center></pre></bdo></b><th id='rIhvr'></th></span></q></dt></tr></i><div id='rIhvr'><tfoot id='rIhvr'></tfoot><dl id='rIhvr'><fieldset id='rIhvr'></fieldset></dl></div>
                      <legend id='rIhvr'><style id='rIhvr'><dir id='rIhvr'><q id='rIhvr'></q></dir></style></legend>

                      • <tfoot id='rIhvr'></tfoot>
                        • <bdo id='rIhvr'></bdo><ul id='rIhvr'></ul>

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

                              <tbody id='rIhvr'></tbody>