Oracle
 sql >> Base de Dados >  >> RDS >> Oracle

SQL:Como encontrar duplicatas com base em dois campos?

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