From a5f9aa25d73f274c6d9accb6fca6424170b9ae08 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Wed, 27 Mar 2024 00:10:43 +0100 Subject: [PATCH] clean up the orderby_item rule --- .../main/asciidoc/ch04-query-language.adoc | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) 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 ::=