I have the following SQL query:
SELECT DISTINCT 'user_id' AS 'id', 'user_name' AS 'name' FROM 'users' ORDER BY 'id' ASC;
That generates output:
+----+--------+
| id | name |
+----+--------+
| 1 | Calebe |
| 2 | João |
| 3 | Lucas |
| 4 | Pedro |
+----+--------+
However, I need determined user
to come in the results, before the others.
Example : I want user_id = 3
to appear at the top. Then the result should come as follows:
+----+--------+
| id | name |
+----+--------+
| 3 | Lucas |
| 1 | Calebe |
| 2 | João |
| 4 | Pedro |
+----+--------+
How can I do this?