MySQL Order by column = x, column asc? -


i won't paste whole query. looks this.

select *, month(date_created) month  table  group month order month='3', month asc 

as april , querying year have expected order follows 3, 1, 2, 4.

instead out 1, 2, 4, 3.

how can change order part of statement order results selected month first rest of months in year showing sequentially?

add desc

order month = '3' desc, month asc 

month='3' boolean expression returns 1 or 0, when result zero, on last part of result.

or without using desc, use <>

order month <> '3', month asc 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -