You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@TestpublicvoidtestSqlPars() {
// 此sql可以正常执行Stringsql ="SELECT B.CUSTOMER_ID customerId,B.CN_NAME NAME,OPENING_DATE,CLOSING_DATE,count(A.OPENING_DATE) over (partition BY B.CUSTOMER_ID ORDER BY trunc(A.OPENING_DATE,'mm') RANGE BETWEEN interval '3' month (4) preceding AND CURRENT ROW) AS createCount,count(A.CLOSING_DATE) over (partition BY B.CUSTOMER_ID ORDER BY trunc(NVL(A.CLOSING_DATE,SYSDATE),'mm') RANGE BETWEEN interval '3' month (4) preceding AND CURRENT ROW) AS cancelCount,row_number () over (partition BY B.CUSTOMER_ID ORDER BY trunc(A.OPENING_DATE) DESC) AS row_flg FROM account_info A,CUSTOMER_INFO B WHERE A.CUSTOMER_ID=B.CUSTOMER_ID";
SQLUtils.format(sql, DbType.oracle);
}
报错:
com.alibaba.druid.sql.parser.ParserException: syntax error, expect AND, actual IDENTIFIER pos 210, line 1, column 202, token IDENTIFIER preceding
at com.alibaba.druid.sql.parser.SQLExprParser.accept(SQLExprParser.java:3980)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.parseAggregateExpr(OracleExprParser.java:866)
at com.alibaba.druid.sql.parser.SQLExprParser.methodRest(SQLExprParser.java:1554)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.methodRest(OracleExprParser.java:495)
at com.alibaba.druid.sql.parser.SQLExprParser.parseSelectItem(SQLExprParser.java:5432)
at com.alibaba.druid.sql.parser.SQLSelectParser.parseSelectList(SQLSelectParser.java:973)
The text was updated successfully, but these errors were encountered:
1.2.3版本
报错:
The text was updated successfully, but these errors were encountered: