Learn the Tricks of Using ROW_NUMBER() in MySQL 8

Get the top N rows from each category in MySQL with simple queries

Lynn G. Kwong
Level Up Coding
Published in
5 min readMar 29, 2024

--

Image by geralt (Entrepreneur Diagram Curve) in Pixabay

In this post, we will introduce how to use the new ROW_NUMBER() function in MySQL 8 to solve various practical problems. Using this function, the queries can be dramatically simplified and efficiency boosted. We will also compare the syntax with MySQL 5.7 so you can…

--

--

I’m a Software Developer (https://medium.com/@lynn-kwong) keen on sharing thoughts, tutorials, and solutions for the best practice of software development.