mysql - Order one field both ASC and DESC -


i've got table events i'd show. want sort events in future ascending, , past in descending order. how can 1 query?

my current order

dec 23 nov 10 nov 04 sep 12 aug 01 jul 23 

the order want

nov 4 ** changed place nov 10 dec 23 ** changed place sep 12 aug 01 jul 23 

many in advance.

you asking sort distance current date:

select *  table  order if(date_field >= now()),0,1), abs(datediff(now(), date_field)) 

Comments

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -