I am using MySQL, and I check some SQL tutorial, I see that that is a statement that called ORDER BY
, which is usually ORDER BY
a column, with AESC
or DESC
. But is this possible to ORDER
the data by different sorting algo?
For example, I have follow value in my DB:
`id`,`name`,`notice_day`
I would like to sort
the day with today first, and than the day that near today, and then, tomorrow....bababa, after finish sorting the day from today, and future, yesterday, and so far....Here is the example, assame today is 1/1/2012
`1`, `peter`, `1/1/2012`
`2`, `tom`, `31/12/2011`
`3`, `mary`, `1/2/2012`
`4`, `steve`, `1/1/2011`
`5`, `bill`, `1/4/2012`
The sorting order I would like to is here:
`1`, `peter`, `1/1/2012`
`3`, `mary`, `1/2/2012`
`5`, `bill`, `1/4/2012`
`2`, `tom`, `31/12/2011`
`4`, `steve`, `1/1/2011`