jackleeonlyone 2019-05-11 23:44 采纳率: 100%
浏览 2286
已结题

在Oracle 中 in的个数不能超过1000,但是这个语句中最多只能29个,大神求解

select regexp_substr((select visavis from empassess where id = 151),
                             '[^,]+',
                             1,
                             level) 
          from dual

        connect by regexp_substr((select visavis
                                   from empassess
                                  where id = 151),
                                 '[^,]+',
                                 1,
                                 level) is not null)
 order by id

在这语句中是有31条数据;图片说明

select count(id)
  from hrmresource
 where id in
       (select regexp_substr((select visavis from empassess where id = 151),
                             '[^,]+',
                             1,
                             level)
          from dual

        connect by regexp_substr((select visavis
                                   from empassess
                                  where id = 151),
                                 '[^,]+',
                                 1,
                                 level) is not null)

图片说明

但是这个只有29条,

前提说明一下,这个hrmresource 表中存在这个31个的ID

所以求助这个是什么原因导致

  • 写回答

3条回答

  • threenewbee 2019-05-12 10:59
    关注

    29说的是嵌套的层数。因为数据库查询不像编程语言可以递归调用,都需要展开的,所以这个层数在不同数据库里都不是很大,access是8层,sql server是16层,oracle30层已经不小了。

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料