diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/grammar-3.11.txt b/jOOQ-manual/src/main/resources/org/jooq/web/grammar-3.11.txt index bc35afd4b5..a6cb5e149e 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/grammar-3.11.txt +++ b/jOOQ-manual/src/main/resources/org/jooq/web/grammar-3.11.txt @@ -365,8 +365,8 @@ selectField = field [ [ 'AS' ] identifier ] tableExpression = [ 'FROM' tables ] - [ connectBy ] [ 'WHERE' condition ] + [ connectBy ] [ groupBy ] [ 'HAVING' condition ] [ 'WINDOW' windows ] diff --git a/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java b/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java index 41dd9ba7b9..002c39045f 100644 --- a/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java @@ -1115,6 +1115,9 @@ final class ParserImpl implements Parser { if (from != null && from.size() == 1 && from.get(0).getName().equalsIgnoreCase("dual")) from = null; + if (parseKeywordIf(ctx, "WHERE")) + where = parseCondition(ctx); + if (parseKeywordIf(ctx, "START WITH")) { startWith = parseCondition(ctx); parseKeyword(ctx, "CONNECT BY"); @@ -1129,9 +1132,6 @@ final class ParserImpl implements Parser { startWith = parseCondition(ctx); } - if (parseKeywordIf(ctx, "WHERE")) - where = parseCondition(ctx); - if (parseKeywordIf(ctx, "GROUP BY")) { if (parseIf(ctx, '(')) { parse(ctx, ')');