首页 > 其他 > 详细

关联表多字段匹配

时间:2015-11-16 12:40:19      阅读:277      评论:0      收藏:0      [点我收藏+]

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!