时间日期相关
日转月格式
select substr("abc", 1,2);
select substr('20200303', 1,6) month;
日期格式转化
select substr(REPLACE('2014-08-31','-',''),1,6);
select TO_CHAR('2019-02-24 22:30:29','yyyymm');
select concat(split_part('08/30/2020','/',3),split_part('08/30/2020','/',1),split_part('08/30/2020','/',2));
计算月份差
select datediff(TO_DATE('202007','yyyymm'),TO_DATE('202008','yyyymm'),'mm');
if函数
select if(b.original_order_id is null,'直接付费','有过试用') as info;
ODPS导出数据
tunnel download -c GBK -h=True lintt_dingyue_rukou_20200619 lintt_yingdaoye_20200618_success_5.csv;--直接导出表,无条数限制。