关联表多字段匹配

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

转载于:https://my.oschina.net/u/1866459/blog/530794

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值