diff --git a/spec/src/main/asciidoc/ch04-query-language.adoc b/spec/src/main/asciidoc/ch04-query-language.adoc index 90807119..3ba014db 100644 --- a/spec/src/main/asciidoc/ch04-query-language.adoc +++ b/spec/src/main/asciidoc/ch04-query-language.adoc @@ -3038,14 +3038,16 @@ The syntax of the ORDER BY clause is: ---- orderby_clause ::= ORDER BY orderby_item {, orderby_item}* -orderby_item ::= - {state_field_path_expression | general_identification_variable | result_variable | scalar_expression} - [ASC | DESC] - [NULLS {FIRST | LAST}] +orderby_item ::= orderby_expression [ASC | DESC] [NULLS {FIRST | LAST}] +orderby_expression ::= + state_field_path_expression | + general_identification_variable | + result_variable | + scalar_expression ---- -The ORDER BY clause specifies a list of items. Each `orderby_item` must be -one of the following: +The ORDER BY clause specifies a list of items. Each `orderby_expression` +must be one of the following: 1. A `state_field_path_expression` evaluating to an orderable state field of an entity or embeddable class abstract schema type designated in the @@ -3336,10 +3338,12 @@ groupby_clause ::= GROUP BY groupby_item {, groupby_item}* groupby_item ::= single_valued_path_expression | identification_variable having_clause ::= HAVING conditional_expression orderby_clause ::= ORDER BY orderby_item {, orderby_item}* -orderby_item ::= - {state_field_path_expression | general_identification_variable | result_variable | scalar_expression} - [ASC | DESC] - [NULLS {FIRST | LAST}] +orderby_item ::= orderby_expression [ASC | DESC] [NULLS {FIRST | LAST}] +orderby_expression ::= + state_field_path_expression | + general_identification_variable | + result_variable | + scalar_expression subquery ::= simple_select_clause subquery_from_clause [where_clause] [groupby_clause] [having_clause] subquery_from_clause ::=