Today, SQL statement sorting, there are special requirements, not only ASC, DESC simple forward order, reverse order, according to the value of the field, to execute the sort.

You can use the following methods:

` ``order by case `state` when then 1/2 / the duty is 2, row in the first then the when 1/2 / the duty is 1, the second the when 3 then 3 / / the duty for 3, ranked third end asc / / in the above order, positive sequence alignment can desc ()Copy the code