我正在 Responsys 中执行此查询并解释计划。
此查询的解释计划运行良好,并返回大约 70 行计数数据:
select * from ( Select LOCATION, count(LOCATION) COUNT_LOCATION From TABLE Group By LOCATION Order By COUNT_LOCATION Desc )
WHERE ROWNUM <= 10
但在末尾添加行限制子句:
select * from ( Select LOCATION, count(LOCATION) COUNT_LOCATION From TABLE Group By LOCATION Order By COUNT_LOCATION Desc ) WHERE ROWNUM <= 10
解释计划中的这个错误导致:
错误:java.sql.SQLException:ORA-00604:递归 SQL 级别 1 发生错误 ORA-12899:列“ACME_CUST”的值太大。“PLAN_TABLE”。“OPTIONS”(实际:33,最大值:30):解释计划将 statement_id ='ACME_CUST:1550184818627' 放入 acme_CUST.PLAN_TABLE for select * from ( Select LOCATION, count(LOCATION) COUNT_LOCATION From TABLE Group By LOCATION Order By COUNT_LOCATION Desc ) WHERE ROWNUM <= 10
我正在寻找的结果只是 LOCATION 的前 10 行计数。