i'd use an order by clause.
select name
from mytable
order by case
when name = 'D' then ''
else name
end case
-- bruce (sqlwork.com)
Thanks, but i get an error when executing it in Studio Management:
Incorrect syntax near the keyword 'case'.
> i'd use an order by clause.
>
[quoted text clipped - 28 lines]
>> Thanks
>> Bart
bruce barker - 03 Feb 2008 05:23 GMT
simple typo (its just case ... end), you should read the docs:
select name
from mytable
order by case
when name = 'D' then ''
else name
end
> Thanks, but i get an error when executing it in Studio Management:
> Incorrect syntax near the keyword 'case'.
[quoted text clipped - 31 lines]
>>> Thanks
>>> Bart
Bart - 03 Feb 2008 11:30 GMT
Thanks, it works now
> simple typo (its just case ... end), you should read the docs:
>
[quoted text clipped - 40 lines]
>>>> Thanks
>>>> Bart