您的位置:首页 > 数据库 > Oracle

Oracle含有空值的行数据排序问题

2012-04-24 22:22 357 查看
可以使用 nulls first 和 nulls last 把空值行排到前面和后面,例:

1 select PatientName,BedNo
2  from T_PatientInHospital
3 where DepartmentCode='0608'
4 order by to_number(BedNo) nulls first



1 select PatientName,BedNo
2 from T_PatientInHospital
3 where DepartmentCode='0608'
4 order by to_number(BedNo) nulls last

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  oracle