I have a SQL query written by someone else and I\'m trying to figure out what it does. Can someone please explain what the Partition By and Row_Number
Partition By
Row_Number
I often use row_number() as a quick way to discard duplicate records from my select statements. Just add a where clause. Something like...
select a,b,rn from (select a, b, row_number() over (partition by a,b order by a,b) as rn from table) where rn=1;