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