Let's say I have this in a column:
'a'
'b'
'c'
'd'
'e'
I want the data to be sorted and looked like this:
'a'
'b'
'd'
'e'
'c'
Is this possible?
Let's say I have this in a column:
'a'
'b'
'c'
'd'
'e'
I want the data to be sorted and looked like this:
'a'
'b'
'd'
'e'
'c'
Is this possible?
select letter
from letters
order by
case letter
when 'a' then 0
when 'b' then 1
when 'd' then 2
when 'e' then 3
when 'c' then 4
end
An other way around using CASE
statement is,
Query
select [column_name]
from [your_table_name]
order by
case [column_name]
when 'c' then 2
else 1 end,
[column_name];