1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Make GROUP BY work with aliases, ORDER BY with column numbers

This commit is contained in:
Bruce Momjian
1996-12-17 01:53:43 +00:00
parent ec105b6026
commit db7a90f1d9
4 changed files with 111 additions and 66 deletions

View File

@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: nodes.h,v 1.3 1996/11/03 12:12:52 scrappy Exp $
* $Id: nodes.h,v 1.4 1996/12/17 01:53:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -190,7 +190,7 @@ typedef enum NodeTag {
T_ParamString,
T_TimeRange,
T_RelExpr,
T_SortBy,
T_SortGroupBy,
T_RangeVar,
T_TypeName,
T_IndexElem,

View File

@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: parsenodes.h,v 1.7 1996/11/13 20:56:15 scrappy Exp $
* $Id: parsenodes.h,v 1.8 1996/12/17 01:53:43 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -463,7 +463,7 @@ typedef struct CursorStmt {
List *fromClause; /* the from clause */
Node *whereClause; /* qualifications */
List *groupClause; /* group by clause */
List *orderClause; /* sort clause (a list of SortBy's) */
List *sortClause; /* sort clause (a list of SortGroupBy's) */
} CursorStmt;
/* ----------------------
@@ -480,7 +480,7 @@ typedef struct RetrieveStmt {
Node *whereClause; /* qualifications */
List *groupClause; /* group by clause */
Node *havingClause; /* having conditional-expression */
List *orderClause; /* sort clause (a list of SortBy's) */
List *sortClause; /* sort clause (a list of SortGroupBy's) */
} RetrieveStmt;
@@ -627,14 +627,15 @@ typedef struct RelExpr {
} RelExpr;
/*
* Sortby - for order by clause
* SortGroupBy - for order by clause
*/
typedef struct SortBy {
typedef struct SortGroupBy {
NodeTag type;
int resno; /* target number */
char *range;
char *name; /* name of column to sort on */
char *useOp; /* operator to use */
} SortBy;
} SortGroupBy;
/*
* RangeVar - range variable, used in from clauses