php - MySQL Order by specific rows only -
i have mysql query returns results in following way:
id | count | type ------------------ 1 | 1000 | 1 2 | 100 | 2 3 | 80 | 2
i order results rows type
2
. order of other rows not matter, although control on order them useful down line. resulting order therefore id = 2
id = 3
id = 1
. possible without doing in post-processing?
if want order rows type 2
first , else after:
select ... order if(type = 2, 0, 1) asc
Comments
Post a Comment