执行有问题的SQL:
select *
from (select a.id, to_char(listagg(b.param_value, ',') within group(order by b.param_value)) userparamvalue
from t_sys_type_item_param a
left join t_item_param b
on a.type_id = b.type_id
group by a.id)
where rownum < ?
错误堆栈:
2014-05-05 16:28:06,193 WARN [com.alibaba.druid.sql.SQLUtils] -
com.alibaba.druid.sql.parser.ParserException: syntax error, expect RPAREN, actual IDENTIFIER within
at com.alibaba.druid.sql.parser.SQLExprParser.accept(SQLExprParser.java:1377)
at com.alibaba.druid.sql.parser.SQLExprParser.methodRest(SQLExprParser.java:635)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.methodRest(OracleExprParser.java:516)
at com.alibaba.druid.sql.parser.SQLExprParser.primaryRest(SQLExprParser.java:600)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.primaryRest(OracleExprParser.java:677)
at com.alibaba.druid.sql.parser.SQLSelectParser.parseSelectList(SQLSelectParser.java:279)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.query(OracleSelectParser.java:267)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.select(OracleSelectParser.java:88)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.parseTableSource(OracleSelectParser.java:711)
at com.alibaba.druid.sql.parser.SQLSelectParser.parseFrom(SQLSelectParser.java:304)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.query(OracleSelectParser.java:272)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.select(OracleSelectParser.java:88)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleStatementParser.parseStatementList(OracleStatementParser.java:166)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:107)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:102)
at com.alibaba.druid.sql.SQLUtils.toStatementList(SQLUtils.java:152)
at com.alibaba.druid.sql.SQLUtils.format(SQLUtils.java:165)
at com.alibaba.druid.filter.logging.LogFilter.logExecutableSql(LogFilter.java:542)
at com.alibaba.druid.filter.logging.LogFilter.statementExecuteUpdateAfter(LogFilter.java:511)
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeUpdate(FilterEventAdapter.java:493)
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeUpdate(FilterChainImpl.java:2719)
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.executeUpdate(PreparedStatementProxyImpl.java:145)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeUpdate(DruidPooledPreparedStatement.java:253)
虽然是警告错误,不影响正常业务逻辑,也还请修正错误。
猜测是和 listagg 函数有关。