LoginSignup
0
0

More than 3 years have passed since last update.

SQL 重複レコードの検索

Posted at

重複レコードを検索するSQL

ほとんど自分用のメモです。

SELECT *
FROM `テーブルA` AS table1
WHERE EXISTS(
              SELECT table2.`列A`
              FROM `テーブルA` AS table2
              WHERE table1.`列A` = table2.`列A`
              GROUP BY table2.`列A`
              HAVING COUNT(table2.`列A`) > 1
          )
ORDER BY table1.`列A`;

参考

重複しているレコードを検索するSQL(大量データも対応)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0