How to retrieve earliest ‘date’ for each ‘id’.
Example table:
id | created_at |
---|---|
1 | 2024-06-28 02:30:12 |
1 | 2024-06-28 05:45:21 |
2 | 2024-06-28 07:31:12 |
2 | 2024-06-28 08:12:33 |
2 | 2024-06-28 08:11:54 |
3 | 2024-06-28 07:20:10 |
3 | 2024-06-28 08:11:58 |
In this case earliest date i wanna take is ‘created_at’ within ‘id’. So, the result are:
id | created_at |
---|---|
1 | 2024-06-28 02:30:12 |
2 | 2024-06-28 07:31:12 |
3 | 2024-06-28 07:20:10 |
New contributor
Arkhan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.