参考: http://www.mysqltutorial.org/mysql-window-functions/mysql-lag-function/中的例子:
SELECT val, ROW_NUMBER() OVER w AS 'row_number', CUME_DIST() OVER w AS 'cume_dist', PERCENT_RANK() OVER w AS 'percent_rank' FROM numbers WINDOW w AS (ORDER BY val);
会报如下错误:
com.alibaba.druid.sql.parser.ParserException: syntax error, error in :'NDOW w AS (ORDER BY val)', expect IDENTIFIER, actual IDENTIFIER pos xxx, line 36, column 12, token IDENTIFIER w
at com.alibaba.druid.sql.parser.SQLParser.printError(SQLParser.java:287)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:532)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:171)
at com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils.parameterize(ParameterizedOutputVisitorUtils.java:98)
at com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils.parameterize(ParameterizedOutputVisitorUtils.java:81)
at com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils.parameterize(ParameterizedOutputVisitorUtils.java:54)
at com.alibaba.druid.filter.stat.StatFilter.mergeSql(StatFilter.java:147)
at com.alibaba.druid.filter.stat.StatFilter.createSqlStat(StatFilter.java:648)
at com.alibaba.druid.filter.stat.StatFilter.statementPrepareAfter(StatFilter.java:311)
at com.alibaba.druid.filter.FilterEventAdapter.connection_prepareStatement(FilterEventAdapter.java:124)
at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:568)
at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.prepareStatement(ConnectionProxyImpl.java:341)
at com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:350)
1条答案
按热度按时间xuo3flqw1#
升到druid-1.1.20版本试试看