select from_unixtime(unix_timestamp('20180801','yyyyMMdd'),'yyyy-MM-dd');
#2018-08-01
#昨日pt
select from_unixtime(unix_timestamp(date_sub(from_unixtime(unix_timestamp(),'yyyy-MM-dd'),1),'yyyy-MM-dd'),'yyyyMMdd');
#20180731
select from_unixtime(unix_timestamp('20180801','yyyyMMdd'),'yyyy-MM-dd');
#2018-08-01
#昨日pt
select from_unixtime(unix_timestamp(date_sub(from_unixtime(unix_timestamp(),'yyyy-MM-dd'),1),'yyyy-MM-dd'),'yyyyMMdd');
#20180731