mysql sorting by 2 columns dependencies -


i'm searching trick, how sort this: have 2 columns: status (numeric) , modification_date (date).

if status<9 (means me if case not closed) - should "order status,modification_date

if status=9 (if case closed) - should sorted "order status,modification_date desc

so - if have cases not closed - should first in chronological order, if closed - should in reversed order (newest first)

i hoped, can union, it's not possible use "order by" in both sections (or maybe i'm doing wrong)

is possible do?

order status,          if(status < 9, 1, -1) * modification_date 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -