mysql - how to create 2 order by in the same column -


i want create sql req twice use of order in same column try exemple

select  titleen, smalldescriptionen, startdate, enddate             event             enddate > now()             order startdate asc  union  select  titleen, smalldescriptionen, startdate, enddate                 event                 enddate < now()                 order startdate desc 

but sql error indicated incorrect usage of union , order by

#1221 - incorrect usage of union , order  

one order by @ end enough order complete result set

select titleen,        smalldescriptionen,        startdate,        enddate   event  enddate < now() union select titleen,        smalldescriptionen,        startdate,        enddate   event  enddate > now() order  startdate desc;  

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -