sql大数据批量查询,堡垒机建表

注:以下内容为工作积累所用,非学术派

为保证工作机密性,所用表名和列名会做加密处理

create table temp1 nologging as

  select 号码,名称 from 信息表 where 1=0(条件永不成立,导出表结构时用)

select a.*,rowid from temp1 a(表别名);

create table temp1 nologging as

  select /*+APPEND PARALLEL(32)+*/ distinct 唯一号 from (

     select 唯一号 from 信息表 a right join (输入右表全部数据,左表搜索符合条件的记录) temp1 t on t.号码=a.号码and t.名称=a.名称

union all

    select 唯一号 from 信息表 a right join temp1 t on t.号码=a.号码and t.名称=a.名称

create table temp1 nologging as

  select /*+APPEND PARALLEL(32)+*/ distinct 唯一号 from 目标表 a where exists(select 1 from temp1 t where a.唯一号=t.唯一号

and a.查询子目代码='xxxxxx'

and a.查询时间=date‘xxxx-xx-xx’

select count(1) from temp1

update 目标表 a set 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值