1. 文件处理:
cat kyfx_ci_loc_tmp.dat|awk ‘BEGIN{FS="|";OFS="|"}{print $1,$7,substr($14,1,6),substr($15,1,6)}‘>kyfx_ci_loc.dat
select * into tmp_kyfx_web_account from kyfx_web_account 
2.数据入库:
load table dba.kyfx_ci_loc_tmp2( f_city_id ‘|‘, f_ci ‘|‘, f_longtitude_baidu ‘|‘, f_latitude_baidu 0x0a ) from ‘/xwtec/tmp_data/kyfx_ci_loc.dat‘ escapes off quotes off with checkpoint on
3.建视图关联两张查询表的两个字段来确定记录唯一:
CREATE VIEW ci_map_baidu2 AS SELECT L.city_id,L.mdn_num,L.s_cycle_date,M.f_longtitude_baidu ,M.f_latitude_baidu from ci_num_data L join kyfx_ci_loc_tmp2 M on L.city_id=M.f_city_id and L.start_ci=M.f_ci
原文:http://my.oschina.net/u/1866459/blog/530794