select - How to sort by three-characters weekday in MYSQL -


i have mysql table column three-characters weekdays like

mon, tue, wed, thu..

now want order select query these weekdays (not alphabetically!). when following line, it's doesn't work:

select * table order str_to_date(day, '%a') 

can give me working query?

try below code

select * `table` order field(`day`, 'mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'); 

Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -