这个语句怎么写??? [最优解释] select * from tablename order by case when DEPART_BELONG='市直部门' then 1 else 0 end [其他解释]
select * from tablename order by case when DEPART_BELONG='市直部门' then 1 else 0 end 这样排序完了取第m条到第n条数据就行 [其他解释] 你是下想分页后,在不影响每页数据的情况下,每页中出现'市直部门'的就排在最后么,那你分页后在用order by case when DEPART_BELONG='市直部门' then 1 else 0 end [其他解释]
2楼的语句是实现这样的效果。没问题的。 [其他解释]
select * from table where DEPART_BELONG!='市直部门' union all select * from table where DEPART_BELONG='市直部门'