I have a table in the database that i'd like to retrieve distinct values in an order from the oldest to the most recent.
The closest result I got was this using this sql command:
SELECT userID FROM commande ORDER BY date_commande ASC, userID ASC;
userID
1
1
2
2
3
3
2
1
1
2
2
As you can see, the values are repetitive, i want to get a result that doesn't repeat when the items I retrieve have the same userID and datetime:
userID
1
2
3
2
1
2
I appreciate your help,
Full table: Name of the table: Commande