数据库和表来至:
MySQL -- 创建函数(Function
http://www.cnblogs.com/mafeng/p/7121473.html
谢谢!
全部显示,但只对工资大于等于5300的记录排序降序:
select * from employees order by if(employee_salary >=5300,employee_salary, 0) desc;
全部显示,但只对工资大于等于5300的记录降序,其它记录升序:
select * from employees order by if(employee_salary >=5300,employee_salary, 0) desc, if(employee_salary < 5300,employee_salary, 0) asc;