ORA-01795 是否有解决方法:列表中的最大表达式数为 1000 错误? [英] Is there a workaround for ORA-01795: maximum number of expressions in a list is 1000 error?

查看:30
本文介绍了ORA-01795 是否有解决方法:列表中的最大表达式数为 1000 错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有解决方法

'ORA-01795: 列表中的最大表达式数为 1000 错误'

我有一个查询,它根据一个字段的值选择字段.我正在使用 in 子句并且有 10000+ 个值

I have a query and it is selecting fields based on the value of one field. I am using the in clause and there are 10000+ values

示例:

select field1, field2, field3 
from table1 
where name in 
(
'value1',
'value2',
...
'value10000+'
);

每次执行查询时,我都会得到ORA-01795:列表中的最大表达式数为 1000 个错误.我正在尝试在 TOAD 中执行查询,没有区别,同样的错误.我将如何修改查询以使其工作?

Every time I execute the query I get the ORA-01795: maximum number of expressions in a list is 1000 error. I am trying to execute the query in TOAD, no difference, the same error. How would I modify the query to get it to work?

提前致谢

推荐答案

只需使用多个 in-clauses 来解决这个问题:

Just use multiple in-clauses to get around this:

select field1, field2, field3 from table1 
where  name in ('value1', 'value2', ..., 'value999') 
    or name in ('value1000', ..., 'value1999') 
    or ...;

这篇关于ORA-01795 是否有解决方法:列表中的最大表达式数为 1000 错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆