diff options
Diffstat (limited to 'doc/src/sgml/ref/select.sgml')
| -rw-r--r-- | doc/src/sgml/ref/select.sgml | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml index 0af1fbb07a..f77b805118 100644 --- a/doc/src/sgml/ref/select.sgml +++ b/doc/src/sgml/ref/select.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.95 2007/01/09 02:14:10 tgl Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.96 2007/01/09 16:59:20 tgl Exp $ PostgreSQL documentation --> @@ -644,13 +644,6 @@ HAVING <replaceable class="parameter">condition</replaceable> <synopsis> ORDER BY <replaceable class="parameter">expression</replaceable> [ ASC | DESC | USING <replaceable class="parameter">operator</replaceable> ] [ NULLS { FIRST | LAST } ] [, ...] </synopsis> - <replaceable class="parameter">expression</replaceable> can be the - name or ordinal number of an output column - (<command>SELECT</command> list item), or it can be an arbitrary - expression formed from input-column values. - </para> - - <para> The <literal>ORDER BY</literal> clause causes the result rows to be sorted according to the specified expression(s). If two rows are equal according to the leftmost expression, they are compared @@ -660,6 +653,13 @@ ORDER BY <replaceable class="parameter">expression</replaceable> [ ASC | DESC | </para> <para> + Each <replaceable class="parameter">expression</replaceable> can be the + name or ordinal number of an output column + (<command>SELECT</command> list item), or it can be an arbitrary + expression formed from input-column values. + </para> + + <para> The ordinal number refers to the ordinal (left-to-right) position of the result column. This feature makes it possible to define an ordering on the basis of a column that does not have a unique @@ -718,6 +718,12 @@ SELECT name FROM distributors ORDER BY code; </para> <para> + Note that ordering options apply only to the expression they follow; + for example <literal>ORDER BY x, y DESC</> does not mean + the same thing as <literal>ORDER BY x DESC, y DESC</>. + </para> + + <para> Character-string data is sorted according to the locale-specific collation order that was established when the database cluster was initialized. |
