Order by clause
Syntax
orderby-clause: 'order' 'by' order-field-list
order-field-list: order-field
order-field: fieldname ('desc | 'descending')?
Functionally
The order by clause takes a list-of-node and sorts it's children predicated by the ordering list. The result is the same collection (list-of-node) in a different order.
list-of-node -> (ordered) list-of-node
Multiple values
When comparing values, the ordering may encounter a row
with multiple nodes
with the same name.
The order by clause assumes a table structure and may expect only one value.
If multiple nodes are encountered Only the first encountered node has to be compared. It's up to to the algorithm which one that is.
Nested values
If one of the nodes is a nested structure, it SHOULD be ignored in the ordering.