elect cast ( 1 as bigint);
select cast ( '2015-4-19' as date);
5 日期函数
to_date
year month day
weekofyear
datediff 两个日期相差的天数
date_add
date_sub
6 条件函数
coalesce:从左到右返回第一个不为null的值
case....when....:条件表达式
case a when b then c [when d then e]* [else f] end
a==b => c
a==d => e
else => f
// 例子:给员工涨工资,总裁1000,经理800,其他400
select ename,job,sal,
case job when 'president' then sal+1000
when 'manager' then sal+800
end
from emp;