[b]data in myTable1[/b]
<font color='"Blue"'>(ID) name</font>
<font color='"red"'>(3) Jack</font>
I have data in myTable1 like the above.
Because (3) Jack is a kind of sticky, I like to make jack comes first or last.
The following would-be code is one of my trials.
But it seems to be not work as I want.
[b]would be code[/b]
select id, name, CASE WHEN id = '3' THEN 1 ELSE 2 END AS ORDER_KEY
order by ORDER_KEY, id
<font color='"Red"'>(3) Jack</font>
Why? What happens? An error? Not the expected output (if so, what output do you get) ?
And did you think about adding a 'sticky' column to your table?
Sorry, I made a mistake. Maybe it was Capital letters and Small letter problems.
Now I got my target result.
Thank you very much, guido2004.