1.当判断一个字段是否为null的时候:
正确: case when 字段名 is null
错误:case 字段名 when null 该写法虽然不报错,但是不生效。
2.关于小数点保留位数:
cast(字段名 as decimal(10,4))
3.presto中不存在DECODE方法,应采用case when then else end 替换。
4.删除表数据:
delete from 表名;
5.插入数据:
insert into 目的表名 select * from 原表名 where 条件;
注意:presto 目前不支持指定列名插入数据,如果不用*的话,则必须把所有的字段名都写上。
注:基于presto-0.217