Suppose i have a user_data table which contains multiple records of users.
id user_id col1 col2 created_at
1 1 abc x 2019-01-04
2 2 def x 2019-02-01
3 3 ghi x 2019-03-05
4 2 jkl x 2019-07-07
5 2 mno x 2019-06-01
6 3 pqr x 2019-07-11
Now i want to select top 10 latest records per user in a single query.