问题:使用select 查询时,提示“ORA-01795:列表中的最大表达式数为1000”

原因:IN中引用的数据超过了1000条

解决方法:
如果IN引用数据大于1000的话可以用OR语句它拆分成两个或多个in就OK了

举例:
Select * from tablename where col in (‘col1’,’col2’ ……..)
如果in 后面的Item过多的话,超过1000就会出现这种错误。
解决方法是:
Select * from tablename where col in (‘col1’,’col2’ …….., ‘col1000’) or col in (‘col1001’, …………)
有时where后条件比较多的话,最好将两个或多个OR用()括起来,否则得到的结果可能会有错误。

注:博客来源于http://blog.chinaunix.net/uid-12427199-id-3612346.html

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-11
猜你喜欢
  • 2022-12-23
  • 2022-01-04
  • 2022-12-23
  • 2021-10-11
  • 2021-06-26
相关资源
相似解决方案