Oracle
 sql >> Database >  >> RDS >> Oracle

SQL:come trovare duplicati in base a due campi?

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