mirror of
https://github.com/postgres/postgres.git
synced 2025-05-17 06:41:24 +03:00
documentation for HAVING, clean up UNION comment.
This commit is contained in:
parent
ef0eecfa1f
commit
01ecb2e3a0
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.20 1998/02/26 04:33:05 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.21 1998/03/30 19:04:41 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -71,7 +71,8 @@ plan_union_queries(Query *parse)
|
|||||||
union_found = false,
|
union_found = false,
|
||||||
last_unionall_flag = false;
|
last_unionall_flag = false;
|
||||||
|
|
||||||
/*
|
/*------------------------------------------------------------------
|
||||||
|
*
|
||||||
* Do we need to split up our unions because we have UNION and UNION
|
* Do we need to split up our unions because we have UNION and UNION
|
||||||
* ALL?
|
* ALL?
|
||||||
*
|
*
|
||||||
@ -87,10 +88,25 @@ plan_union_queries(Query *parse)
|
|||||||
*
|
*
|
||||||
* So the above query becomes:
|
* So the above query becomes:
|
||||||
*
|
*
|
||||||
* Append Node { Sort and Unique { Append Node { SELECT 1
|
* Append Node
|
||||||
* This is really a sub-UNION, unionClause We run a
|
* {
|
||||||
* DISTINCT on these. { SELECT 2 SELECT 3 } } } SELECT 4 SELECT 5 }
|
* Sort and Unique
|
||||||
|
* {
|
||||||
|
* Append Node
|
||||||
|
* {
|
||||||
|
* SELECT 1 This is really a sub-UNION.
|
||||||
|
* unionClause We run a DISTINCT on these.
|
||||||
|
* {
|
||||||
|
* SELECT 2
|
||||||
|
* SELECT 3
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* SELECT 4
|
||||||
|
* SELECT 5
|
||||||
|
* }
|
||||||
*
|
*
|
||||||
|
*---------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
foreach(ulist, parse->unionClause)
|
foreach(ulist, parse->unionClause)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: psqlHelp.h,v 1.41 1998/03/18 15:48:26 momjian Exp $
|
* $Id: psqlHelp.h,v 1.42 1998/03/30 19:04:53 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -163,6 +163,7 @@ static struct _helpStruct QL_HELP[] = {
|
|||||||
\t[from <from_list>]\n\
|
\t[from <from_list>]\n\
|
||||||
\t[where <qual>]\n\
|
\t[where <qual>]\n\
|
||||||
\t[group by <group_list>]\n\
|
\t[group by <group_list>]\n\
|
||||||
|
\t[having <having_clause>]\n\
|
||||||
\t[order by <attr1> [using <op1>],... <attrN> [using <opN>]]\n\
|
\t[order by <attr1> [using <op1>],... <attrN> [using <opN>]]\n\
|
||||||
\t[union [all] select ...];"},
|
\t[union [all] select ...];"},
|
||||||
{"delete",
|
{"delete",
|
||||||
@ -243,6 +244,7 @@ static struct _helpStruct QL_HELP[] = {
|
|||||||
\t[from <from_clause>]\n\
|
\t[from <from_clause>]\n\
|
||||||
\t[where <qual>]\n\
|
\t[where <qual>]\n\
|
||||||
\t[group by <group_list>]\n\
|
\t[group by <group_list>]\n\
|
||||||
|
\t[having <having_clause>]\n\
|
||||||
\t[union [all] select ...];"},
|
\t[union [all] select ...];"},
|
||||||
{"listen",
|
{"listen",
|
||||||
"listen for notification on a relation",
|
"listen for notification on a relation",
|
||||||
@ -277,6 +279,7 @@ static struct _helpStruct QL_HELP[] = {
|
|||||||
\t[from <from_list>]\n\
|
\t[from <from_list>]\n\
|
||||||
\t[where <qual>]\n\
|
\t[where <qual>]\n\
|
||||||
\t[group by <group_list>]\n\
|
\t[group by <group_list>]\n\
|
||||||
|
\t[having <having_clause>]\n\
|
||||||
\t[order by <attr1> [ASC | DESC] [using <op1>], ... <attrN> ]\n\
|
\t[order by <attr1> [ASC | DESC] [using <op1>], ... <attrN> ]\n\
|
||||||
\t[union [all] select ...];"},
|
\t[union [all] select ...];"},
|
||||||
{"set",
|
{"set",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
.\" This is -*-nroff-*-
|
.\" This is -*-nroff-*-
|
||||||
.\" XXX standard disclaimer belongs here....
|
.\" XXX standard disclaimer belongs here....
|
||||||
.\" $Header: /cvsroot/pgsql/src/man/Attic/select.l,v 1.5 1998/03/18 15:49:08 momjian Exp $
|
.\" $Header: /cvsroot/pgsql/src/man/Attic/select.l,v 1.6 1998/03/30 19:05:10 momjian Exp $
|
||||||
.TH SELECT SQL 11/05/95 PostgreSQL PostgreSQL
|
.TH SELECT SQL 11/05/95 PostgreSQL PostgreSQL
|
||||||
.SH NAME
|
.SH NAME
|
||||||
select - retrieve instances from a class
|
select - retrieve instances from a class
|
||||||
@ -13,6 +13,7 @@ select - retrieve instances from a class
|
|||||||
[\fBfrom\fR from-list]
|
[\fBfrom\fR from-list]
|
||||||
[\fBwhere\fR where-clause]
|
[\fBwhere\fR where-clause]
|
||||||
[\fBgroup by\fR attr_name1 {, attr_name-i....}]
|
[\fBgroup by\fR attr_name1 {, attr_name-i....}]
|
||||||
|
[\fBhaving\fR having-clause]
|
||||||
[\fBorder by\fR attr_name1 [\fBasc\fR | \fBdesc\fR] [\fBusing op1\fR] {, attr_namei...}]
|
[\fBorder by\fR attr_name1 [\fBasc\fR | \fBdesc\fR] [\fBusing op1\fR] {, attr_namei...}]
|
||||||
[\fBunion {all} select\fR ...]
|
[\fBunion {all} select\fR ...]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user