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

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

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

        如何在 Oracle 中的表中查找重复值?

        时间:2023-09-20
        <i id='DGKB4'><tr id='DGKB4'><dt id='DGKB4'><q id='DGKB4'><span id='DGKB4'><b id='DGKB4'><form id='DGKB4'><ins id='DGKB4'></ins><ul id='DGKB4'></ul><sub id='DGKB4'></sub></form><legend id='DGKB4'></legend><bdo id='DGKB4'><pre id='DGKB4'><center id='DGKB4'></center></pre></bdo></b><th id='DGKB4'></th></span></q></dt></tr></i><div id='DGKB4'><tfoot id='DGKB4'></tfoot><dl id='DGKB4'><fieldset id='DGKB4'></fieldset></dl></div>
        <legend id='DGKB4'><style id='DGKB4'><dir id='DGKB4'><q id='DGKB4'></q></dir></style></legend><tfoot id='DGKB4'></tfoot>
      1. <small id='DGKB4'></small><noframes id='DGKB4'>

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

                    <tbody id='DGKB4'></tbody>
                • 本文介绍了如何在 Oracle 中的表中查找重复值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  返回给定列的重复值及其在 Oracle 数据库表中出现次数的最简单的 SQL 语句是什么?

                  What's the simplest SQL statement that will return the duplicate values for a given column and the count of their occurrences in an Oracle database table?

                  例如:我有一个 JOBS 表,其中包含 JOB_NUMBER 列.我如何知道我是否有任何重复的 JOB_NUMBER,以及它们被复制了多少次?

                  For example: I have a JOBS table with the column JOB_NUMBER. How can I find out if I have any duplicate JOB_NUMBERs, and how many times they're duplicated?

                  推荐答案

                  按 COUNT 聚合列,然后使用 HAVING 子句查找出现次数大于一次的值.

                  Aggregate the column by COUNT, then use a HAVING clause to find values that appear greater than one time.

                  SELECT column_name, COUNT(column_name)
                  FROM table_name
                  GROUP BY column_name
                  HAVING COUNT(column_name) > 1;
                  

                  这篇关于如何在 Oracle 中的表中查找重复值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:ORA-00918: 列在 SELECT * 中定义不明确 下一篇:GROUP BY 如何工作?

                  相关文章

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

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

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