You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -644,13 +644,6 @@ HAVING <replaceable class="parameter">condition</replaceable>
644
644
<synopsis>
645
645
ORDER BY <replaceable class="parameter">expression</replaceable> [ ASC | DESC | USING <replaceable class="parameter">operator</replaceable> ] [ NULLS { FIRST | LAST } ] [, ...]
646
646
</synopsis>
647
-
<replaceable class="parameter">expression</replaceable> can be the
648
-
name or ordinal number of an output column
649
-
(<command>SELECT</command> list item), or it can be an arbitrary
650
-
expression formed from input-column values.
651
-
</para>
652
-
653
-
<para>
654
647
The <literal>ORDER BY</literal> clause causes the result rows to
655
648
be sorted according to the specified expression(s). If two rows are
656
649
equal according to the leftmost expression, they are compared
@@ -659,6 +652,13 @@ ORDER BY <replaceable class="parameter">expression</replaceable> [ ASC | DESC |
659
652
an implementation-dependent order.
660
653
</para>
661
654
655
+
<para>
656
+
Each <replaceable class="parameter">expression</replaceable> can be the
657
+
name or ordinal number of an output column
658
+
(<command>SELECT</command> list item), or it can be an arbitrary
659
+
expression formed from input-column values.
660
+
</para>
661
+
662
662
<para>
663
663
The ordinal number refers to the ordinal (left-to-right) position
664
664
of the result column. This feature makes it possible to define an
@@ -717,6 +717,12 @@ SELECT name FROM distributors ORDER BY code;
717
717
on whether the operator is a less-than or greater-than operator.
718
718
</para>
719
719
720
+
<para>
721
+
Note that ordering options apply only to the expression they follow;
722
+
for example <literal>ORDER BY x, y DESC</> does not mean
723
+
the same thing as <literal>ORDER BY x DESC, y DESC</>.
724
+
</para>
725
+
720
726
<para>
721
727
Character-string data is sorted according to the locale-specific
722
728
collation order that was established when the database cluster
0 commit comments