16 create view V
as
select name||' '||sal as data
from student --建立一个视图
select * from V--查询这个视图
17处理数据空值
select xh
from student order by 1 desc—空值排列
18 select xh
from student order by 1 desc nulls last--将空值置于最后排序
19 select id,xh,sal,
case when xh is null then 0 else 1 end as is_null
from student—查找为空的值并建立一个表查看
20根据数据项的值进行排序
select id,xh,sal,depo from student
order by case when depo='工程部' then xh else sal end --有工程部的按照xh排序否则按照工资排序