mysql进行排序的时候如果需要按照原始的顺序排序,就可以使用order by find_in_set()方法,具体用法如下: 代码如下 复制代码 select * from ecs_goods where goods_id in ($idList) order by FIND_IN_SET(goods_id,'$idList') 这句mysql语句用到了find_in_set进行排序,意思是根据goods_id在$idList这个变量中的前后顺序进行排序. 关于类似的自定义排序,还可以用My
复制代码 代码如下: --执行顺序 From Where Select select * from (select sal as salary,comm as commission from emp ) x where salary<5000 --得出 Name Work as a Job select ename +' Work as a'+job as msg from emp where deptno=10 --如果员工工资小于2000返回UnderPaid 大于等于4k 返回OverPa