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

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

      1. <tfoot id='VzMW4'></tfoot>

      2. MySQL 删除与分组依据

        MySQL Delete with Group By(MySQL 删除与分组依据)
          <tbody id='PMKo9'></tbody>
        <tfoot id='PMKo9'></tfoot>

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

              • <bdo id='PMKo9'></bdo><ul id='PMKo9'></ul>

              • <small id='PMKo9'></small><noframes id='PMKo9'>

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

                  问题描述

                  我在 MySQL 5.5 中成功运行了一个查询

                  I am running a query successfully using in MySQL 5.5

                  SELECT columnA
                  FROM
                    table
                  GROUP BY
                    columnA
                  HAVING
                    count(*) > 1
                  

                  但是,我需要使用 DELETE 运行相同的查询,但我有点不确定如何删除?即返回的结果应该被删除吗?

                  However, I need to run this same query using DELETE and I'm a little unsure how to delete ? i.e. the returned results should be deleted ?

                  有什么想法吗?

                  推荐答案

                  将其放在子查询中:

                  delete from table 
                  where columnA in (
                    select columnA
                    from (
                        select columnA
                        from YourTable
                        group by columnA
                        having count(*) > 1
                        ) t  
                  )
                  

                  这篇关于MySQL 删除与分组依据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Include missing months in Group By query(在 Group By 查询中包含缺失的月份)
                  Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
                  MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)

                    <legend id='a2fxn'><style id='a2fxn'><dir id='a2fxn'><q id='a2fxn'></q></dir></style></legend>
                  1. <tfoot id='a2fxn'></tfoot>

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

                        <tbody id='a2fxn'></tbody>

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