how to order list that has date and a word in sql server -


case when prefinallist.truckbooked null 'immediate' else cast(prefinallist.previous_date varchar) end eta  

the list contain either the word immediate or datetime.

how show immediate on top , date in acending.

you can try use order this:

order (`eta` = 'immediate') asc 

or can use case statement inside order like

order case when eta = 'immediate' 1 else 2 end 

Comments

Popular posts from this blog

cron - how to properly run Python script with crontab on every system startup -

elasticsearch - Is the order of operations guaranteed in a bulk update? -

Slow performance first queries on SQL Azure -