insert overwrite table t_fx_latitude_daily partition(stat_time='20120830',latitude_type)select COALESCE(a.user_name,b.user_name,c.user_name,d.user_name,e.user_name,f.user_name,'anonymous'),COALESCE(a.latitude_id,b.latitude_id,c.latitude_id,d.latitude_id,e.latitude_id,f.latitude_id,'-1'),COALESCE(a.send_time,b.send_time,c.send_time,d.send_time,e.send_time,f.send_time,'1000-01-01'),a.send_count,a.bill_count,a.people_count,b.send_count,b.people_count,c.send_count,c.people_count,d.send_count,d.people_count,e.send_count,e.people_count,f.send_count,f.people_count,COALESCE(a.latitude_type,b.latitude_type,c.latitude_type,d.latitude_type,e.latitude_type,f.latitude_type,'null_latitude_type')from (select * from t_latitude_marketing_daily where stat_time='20120830' and marketing_type='sms')afull outer join (select * from t_latitude_marketing_daily where stat_time='20120830' and marketing_type='edm')b on(a.latitude_type=b.latitude_type and a.user_name=b.user_name and a.send_time=b.send_time and a.latitude_id=b.latitude_id)full outer join (select * from t_latitude_marketing_daily where stat_time='20120830' and marketing_type='wap')c on(COALESCE(a.latitude_type,b.latitude_type)=c.latitude_type and COALESCE(a.user_name,b.user_name)=c.user_name and COALESCE(a.send_time,b.send_time)=c.send_time and COALESCE(a.latitude_id ,b.latitude_id)=c.latitude_id)full outer join (select * from t_latitude_marketing_daily where stat_time='20120830' and marketing_type='mms')d on(COALESCE(a.latitude_type,b.latitude_type,c.latitude_type)=d.latitude_type and COALESCE(a.user_name,b.user_name,c.user_name)=d.user_name and COALESCE(a.send_time,b.send_time,c.send_time)=d.send_time and COALESCE(a.latitude_id,b.latitude_id,c.latitude_id)=d.latitude_id)full outer join (select * from t_latitude_marketing_daily where stat_time='20120830' and marketing_type='coupons')e on(COALESCE(a.latitude_type,b.latitude_type,c.latitude_type,d.latitude_type)=e.latitude_type and COALESCE(a.user_name,b.user_name,c.user_name,d.user_name)=e.user_name and COALESCE(a.send_time,b.send_time,c.send_time,d.send_time)=e.send_time and COALESCE(a.latitude_id,b.latitude_id,c.latitude_id,d.latitude_id)=e.latitude_id)full outer join (select * from t_latitude_marketing_daily where stat_time='20120830' and marketing_type='dit_coupons')f on(COALESCE(a.latitude_type,b.latitude_type,c.latitude_type,d.latitude_type,e.latitude_type)=f.latitude_type and COALESCE(a.user_name,b.user_name,c.user_name,d.user_name,e.user_name)=f.user_name and COALESCE(a.send_time,b.send_time,c.send_time,d.send_time,e.send_time)=f.send_time and COALESCE(a.latitude_id,b.latitude_id,c.latitude_id,d.latitude_id,e.latitude_id)=f.latitude_id);