Get Top N
How To Get Top N
Diff Between Rank, Dense_Rank, and Row_Number
topN sql template
select *
from (
select *,
row_number() over (partition by 'The Column That You Are Going To Group'
order by 'The Column That You Are Going To Order' desc) as 'Rank'
from TableName) as a
where 'Rank' <= N;