Get the App
SLTechnology News&Howtos  ›  Database  › 

The number of records in SQL that look for duplicates of a field value or multiple field values

Shulou Source: shulou.com Published: 2022-06-01 07:26:09 09月18日 Update

Filter only one record with the same field value

Select * from A where PDDT in (select PDDT FROM A group by PDDT having count (PDDT) > 1)

Filter multiple records with the same field value

SELECT COUNT (*), DeptID, PDDT, DLNo, DLNoRe, MacNo FROM A GROUP BY DeptID, PDDT, DLNo, DLNoRe, MacNo having count (*) > 1

Tags: Fields same multiple Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Microsoft MySQL Huawei Docker