【发布时间】:2018-03-14 22:03:14
【问题描述】:
要求:必须从 2 个或多个表中选择值,在查询中条件应从 excel 记录中取值(大约 5k)。
查询:
select
distinct
tableA.x
,tableB.phone_nbr,
tableC.tmp_oper_div_cd
from Table A join Table B on A.id= B.iD
left join table C on A.fc = C.fc
left join table h on fc.qr = h.qr
--h.hldx_cd=s.htl_cd
where tableB.phone_nbr like any
('%35051111%' ,'%35051155%','%35051113%','%35051190%')
and h.hldx_cd='TYOHC'
在上面的查询中,(请忽略连接缺陷等,) hldx_cd 和 Phone_nbr 值来自 excel 并且 phone_nbr 值没有正确的格式。在 excel 中,我们得到大约 5k hldx_cd,每个酒店代码都有多个电话号码。
请告诉我实现这一点的逻辑。提前致谢。
【问题讨论】: