How to get the desired result by some my SQL query as I have tried group by and distinct by nothing seems to work fine in this case.
Records:
+----+---------+---------------------+
| id | user_id | created_at |
+----+---------+---------------------+
| 22 | 3 | 2019-09-13 06:35:29 |
| 23 | 3 | 2019-09-13 06:53:59 |
| 24 | 3 | 2019-09-13 06:54:00 |
| 25 | 3 | 2019-09-13 06:54:01 |
| 26 | 3 | 2019-09-13 06:54:02 |
| 27 | 3 | 2019-09-13 06:54:02 |
| 28 | 3 | 2019-09-13 06:54:03 |
| 29 | 3 | 2019-09-13 06:54:03 |
| 30 | 3 | 2019-09-13 06:54:05 |
| 31 | 3 | 2019-09-13 06:54:06 |
| 32 | 3 | 2019-09-13 06:54:06 |
| 33 | 3 | 2019-09-13 06:54:06 |
| 34 | 3 | 2019-09-13 06:54:10 |
| 35 | 3 | 2019-09-13 06:54:10 |
| 36 | 3 | 2019-09-13 06:54:11 |
| 37 | 1 | 2019-09-13 09:52:35 |
| 38 | 2 | 2019-09-13 09:53:46 |
| 39 | 2 | 2019-09-13 09:54:17 |
| 40 | 2 | 2019-09-13 09:54:18 |
| 41 | 2 | 2019-09-13 09:54:18 |
| 42 | 2 | 2019-09-13 09:54:19 |
| 43 | 2 | 2019-09-13 09:54:19 |
| 44 | 2 | 2019-09-13 09:54:20 |
| 45 | 2 | 2019-09-13 09:54:20 |
+----+---------+---------------------+
Expected Result:
+----+---------+---------------------+
| id | user_id | created_at |
+----+---------+---------------------+
| 36 | 3 | 2019-09-13 06:54:11 |
| 37 | 1 | 2019-09-13 09:52:35 |
| 45 | 2 | 2019-09-13 09:54:20 |
+----+---------+---------------------+