I have this query
x
select name,
surname,
age
from user
order by idcard asc
but I want that if idcard
has values 3
those values to be shown together in the end of the list while the rest 1, 2, 4, 5, 6,
to order by asc
is it possible to do?
Advertisement
Answer
You can try using case
:
select
order by case
when idcard = 3 then 1
else 0
end,
idcard