By the end of this page you can answer the question that stops most people the first week they write SQL: which row is the best one in each category. You will know OVER and PARTITION BY , the three ranking functions and how each treats a tie, a running total, and LAG for comparing a row to the o...
Source: [Dev.to](https://dev.to/michaelnocito/sql-window-functions-how-to-get-the-top-row-per-group-1c2p)