Last active
September 4, 2015 22:45
-
-
Save stvkoch/396199 to your computer and use it in GitHub Desktop.
tow mysql orders
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Tow mysql orders, more recent first and old lasts! | |
SELECT IF(dataInitial > NOW(), 0, dataInitial) as dataOrder, dataInitial FROM myTable | |
ORDER BY dataOrder, dataInitial | |
#you can created index on the fly! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment