ORDER BY { column-Name | ColumnPosition | Expression }
    [ ASC | DESC ]
    [ NULLS FIRST | NULLS LAST ]
    [ , column-Name | ColumnPosition | Expression 
    [ ASC | DESC ]
    [ NULLS FIRST | NULLS LAST ]
    ] * 
知识点
- order by后面可以接列号(数字)、列名、别名、表达式、函数、分组函数
- order by对空值的处理,- DESC空值在前,- ASC空值在后;
- order by子句中可以不含- select中的列;
- 当使用select distinct或group by时,order by不能使用select之外的列;
- order by只能放最后,不能放集合操作的中间;
- 集合操作后,不接order by时按第一列进行升序排序(union all除外);
- 集合操作后的列名为第一个select的内容,order by只能选第一个select中的内容进行操作
【Oracle 结论】 
order by colum asc 时,null默认被放在最后
order by colum desc 时,null默认被放在最前
nulls first 时,强制null放在最前,不为null的按声明顺序[asc|desc]进行排序
nulls last 时,强制null放在最后,不为null的按声明顺序[asc|desc]进行排序 
针对【oracle】我们就需要使用以下语法:order by order_col [asc|desc] nulls [first|last]
laravel中orderby时为空字段排在最后面
$query->orderBy(DB::Raw(‘case when distance is null then 99999999999 else distance end’),‘ASC’);
手动排序:
select * from table order by decode(confirm_branchid,‘外科‘,1,‘内科‘,2,‘手术室‘,3,‘化疗室‘,4)
