Oracle
 sql >> Base de données >  >> RDS >> Oracle

SQL :Comment trouver des doublons basés sur deux champs ?

SELECT  *
FROM    (
        SELECT  t.*, ROW_NUMBER() OVER (PARTITION BY station_id, obs_year ORDER BY entity_id) AS rn
        FROM    mytable t
        )
WHERE   rn > 1