关联表多字段匹配

1. 文件处理:web

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.数据入库:sql

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.建视图关联两张查询表的两个字段来肯定记录惟一:shell

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
相关文章
相关标签/搜索