一。条件表达
case when ... then when .... then ... when ... then ...end
select film_id,rpad(title,20," "),case when rating in ("G","PG","PG-13") then "YOUNG" WHEN RATING=="NC-17" THEN "17 AND UP" WHEN RATING="R" THEN "Mature" else "Unrated" end from film;
isnull() 函数
nvl(field ,field/date)
函数如果是空的话用后面的数据或者另外一个字段填空
二聚合函数