1. 12
  1.  

  2. 1

    I think this article is mostly worth a click to see the end result! But also useful to learn about row_number OVER ( ORDER BY ... ) if you haven’t used that yet.