postgresql_16:3.4.2 Table Expressions
PostgreSQL 16 > The SQL Language > Queries > Table Expressions
A *table expression* computes a table. The table expression contains a FROM clause that is optionally followed by WHERE, GROUP BY, and HAVING clauses. Trivial table expressions simply refer to a table on disk, a so-called base table, but more complex expressions can be used to modify or combine base tables in various ways.
The optional WHERE, GROUP BY, and HAVING clauses in the table expression specify a pipeline of successive transformations performed on the table derived in the FROM clause. All these transformations produce a virtual table that provides the rows that are passed to the select list to compute the output rows of the query.
Subsections
- postgresql_16:3.4.2.1 The
FROMClause - postgresql_16:3.4.2.2 The
WHEREClause - postgresql_16:3.4.2.3 The
GROUP BYandHAVINGClauses - postgresql_16:3.4.2.4
GROUPING SETS,CUBE, andROLLUP - postgresql_16:3.4.2.5 Window Function Processing