Home Forums SQL Server 2008 T-SQL (SS2K8) Custom order in SELECT RE: Custom order in SELECT
Erin Ramsay
SSCrazy Eights
Points: 9728
More actions
March 1, 2013 at 2:54 pm
#1592594
If your custom phrase is static you can use:
select letter from @test1 order by (case letter when 'd' then 1 when 'c' then 2 when 'b' then 3 when 'a' then 4 when 'e' then 5 end)