More complete info from Oliver Elphick.
authorThomas G. Lockhart
Sat, 13 Feb 1999 03:32:43 +0000 (03:32 +0000)
committerThomas G. Lockhart
Sat, 13 Feb 1999 03:32:43 +0000 (03:32 +0000)
doc/src/sgml/ref/copy.sgml
doc/src/sgml/ref/select.sgml

index 006b022412144c994dcdaa6640b5c706e88c1c31..39eeec38e4f274e164d56ad15327962419241598 100644 (file)
@@ -395,7 +395,11 @@ has the termination sequence on the last line):
  
  
  
-  Bugs
+  Bugs and features
+  
+   COPY neither invokes rules nor acts on column defaults.
+   It does invoke triggers, however.
+  
   
    COPY stops operation at the first error.  This
    should not lead to problems in the event of
index 6306b490e3b42751e1368753147e8acd34a1d2fe..bf44ee9c3f5a672a42f46096a9d8a95236367d04 100644 (file)
@@ -205,9 +205,15 @@ SELECT [ALL|DISTINCT [ON column] ]
    Description
   
   
-   SELECT will get all rows which satisfy the
- WHERE condition
-   or all rows of a table if WHERE is omitted.
+   SELECT will return rows from one or more tables.
+   Candidates for selection are rows which satisfy the WHERE condition;
+   if WHERE is omitted, all rows are candidates.
+  
+   DISTINCT will eliminate all duplicate rows from the
+   selection.
+   DISTINCT ON column will eliminate all duplicates in the specified column; this is
+equivalent to using GROUP BY column.  ALL will return all candidate rows,
+including duplicates.
    
   
    The GROUP BY clause allows a user to divide a table
@@ -247,8 +253,9 @@ WHERE expr 
     
     
     where cond_op can be
-    one of: =, <, <=, >, >=, <>
-    or a conditional operator like ALL, ANY, IN, LIKE, et cetera
+    one of: =, <, <=, >, >= or <>,
+    a conditional operator like ALL, ANY, IN, LIKE, et cetera or a
+    locally-defined operator, 
     and log_op can be one 
     of: AND, OR, NOT.
     The comparison returns either TRUE or FALSE and all
@@ -266,10 +273,16 @@ WHERE expr 
    
    
     GROUP BY specifies a grouped table derived by the application
-    of the this clause:
+    of this clause:
     
 GROUP BY column [, ...]
-    
+    
+    
+     GROUP BY will condense into a single row all rows that share the same values for the
+     grouped columns; aggregates return values derived from all rows that make up the group.  The value returned for an ungrouped
+     and unaggregated column is dependent on the order in which rows happen to be read from the database.
+    
+
     
   
    
@@ -327,8 +340,8 @@ SELECT title, date_prod + 1 AS newlen FROM films ORDER BY newlen;
     
     
    
-    The columns in the ORDER BY must appear in the SELECT clause.
-    Thus the following statement is illegal:
+    From release 6.4 of PostgreSQL, the columns in the ORDER BY clause do not need to appear in the SELECT clause.
+    Thus the following statement is now legal:
     
 SELECT name FROM distributors ORDER BY code;
     
@@ -409,7 +422,7 @@ SELECT f.title, f.did, d.name, f.date_prod, f.kind
   
   
    To sum the column len of all films and group
-   the reults by kind:
+   the results by kind:
   
   
 SELECT kind, SUM(len) AS total FROM films GROUP BY kind;
@@ -425,7 +438,7 @@ SELECT kind, SUM(len) AS total FROM films GROUP BY kind;
 
   
    To sum the column len of all films, group
-   the reults by kind and show those group totals
+   the results by kind and show those group totals
    that are less than 5 hours:
   
   
@@ -563,6 +576,10 @@ SELECT distributors.* WHERE name = 'Westwood';
      This is not currently
      allowed in Postgres.
     
+     
+    
+     The DISTINCT ON phrase is not part of SQL92.
+