1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/ref/select.sgml,v 1.67 2003/05/04 02:23:16 petere Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/ref/select.sgml,v 1.68 2003/08/17 22:09:00 tgl Exp $
3
3
PostgreSQL documentation
4
4
-->
5
5
@@ -660,8 +660,11 @@ SELECT name FROM distributors ORDER BY code;
660
660
<literal>ORDER BY</> clause. If not specified, <literal>ASC</> is
661
661
assumed by default. Alternatively, a specific ordering operator
662
662
name may be specified in the <literal>USING</> clause.
663
- <literal>ASC</> is equivalent to <literal>USING <</> and
664
- <literal>DESC</> is equivalent to <literal>USING ></>.
663
+ <literal>ASC</> is usually equivalent to <literal>USING <</> and
664
+ <literal>DESC</> is usually equivalent to <literal>USING ></>.
665
+ (But the creator of a user-defined datatype can define exactly what the
666
+ default sort ordering is, and it might correspond to operators with other
667
+ names.)
665
668
</para>
666
669
667
670
<para>
@@ -671,7 +674,7 @@ SELECT name FROM distributors ORDER BY code;
671
674
</para>
672
675
673
676
<para>
674
- Data of character types is sorted according to the locale-specific
677
+ Character-string data is sorted according to the locale-specific
675
678
collation order that was established when the database cluster
676
679
was initialized.
677
680
</para>
@@ -1003,7 +1006,9 @@ SELECT distributors.* FROM distributors d, distributors distributors;
1003
1006
that he will actually get. To help detect this sort of mistake,
1004
1007
PostgreSQL will warn if the implicit-<literal>FROM</literal>
1005
1008
feature is used in a <command>SELECT</command> statement that also
1006
- contains an explicit <literal>FROM</literal> clause.
1009
+ contains an explicit <literal>FROM</literal> clause. Also, it is
1010
+ possible to disable the implicit-<literal>FROM</literal> feature
1011
+ by setting the <varname>ADD_MISSING_FROM</> parameter to false.
1007
1012
</para>
1008
1013
</refsect2>
1009
1014
@@ -1015,7 +1020,7 @@ SELECT distributors.* FROM distributors d, distributors distributors;
1015
1020
noise and can be omitted without affecting the meaning. The
1016
1021
<productname>PostgreSQL</productname> parser requires this key
1017
1022
word when renaming output columns because the type extensibility
1018
- features lead to parsing ambiguities in this context .
1023
+ features lead to parsing ambiguities without it .
1019
1024
<literal>AS</literal> is optional in <literal>FROM</literal>
1020
1025
items, however.
1021
1026
</para>
@@ -1025,7 +1030,7 @@ SELECT distributors.* FROM distributors d, distributors distributors;
1025
1030
<title>Namespace Available to <literal>GROUP BY</literal> and <literal>ORDER BY</literal></title>
1026
1031
1027
1032
<para>
1028
- In the SQL standard, an <literal>ORDER BY</literal> clause may
1033
+ In the SQL92 standard, an <literal>ORDER BY</literal> clause may
1029
1034
only use result column names or numbers, while a <literal>GROUP
1030
1035
BY</literal> clause may only use expressions based on input column
1031
1036
names. <productname>PostgreSQL</productname> extends each of
@@ -1036,6 +1041,13 @@ SELECT distributors.* FROM distributors d, distributors distributors;
1036
1041
expression will always be taken as input-column names, not as
1037
1042
result-column names.
1038
1043
</para>
1044
+
1045
+ <para>
1046
+ SQL99 uses a slightly different definition which is not upward compatible
1047
+ with SQL92. In most cases, however, <productname>PostgreSQL</productname>
1048
+ will interpret an <literal>ORDER BY</literal> or <literal>GROUP
1049
+ BY</literal> expression the same way SQL99 does.
1050
+ </para>
1039
1051
</refsect2>
1040
1052
1041
1053
<refsect2>
0 commit comments