--- title: "Queries" id: queries pg_version: "20devel" --- # Queries ## Table of Contents - [7.1. Overview](queries-overview.md) - [7.2. Table Expressions](queries-table-expressions.md) - [7.2.1. The `FROM` Clause](queries-table-expressions.md#queries-from) - [7.2.2. The `WHERE` Clause](queries-table-expressions.md#queries-where) - [7.2.3. The `GROUP BY` and `HAVING` Clauses](queries-table-expressions.md#queries-group) - [7.2.4. `GROUPING SETS`, `CUBE`, and `ROLLUP`](queries-table-expressions.md#queries-grouping-sets) - [7.2.5. Window Function Processing](queries-table-expressions.md#queries-window) - [7.3. Select Lists](queries-select-lists.md) - [7.3.1. Select-List Items](queries-select-lists.md#queries-select-list-items) - [7.3.2. Column Labels](queries-select-lists.md#queries-column-labels) - [7.3.3. `DISTINCT`](queries-select-lists.md#queries-distinct) - [7.4. Combining Queries (`UNION`, `INTERSECT`, `EXCEPT`)](queries-union.md) - [7.5. Sorting Rows (`ORDER BY`)](queries-order.md) - [7.6. `LIMIT` and `OFFSET`](queries-limit.md) - [7.7. `VALUES` Lists](queries-values.md) - [7.8. `WITH` Queries (Common Table Expressions)](queries-with.md) - [7.8.1. `SELECT` in `WITH`](queries-with.md#queries-with-select) - [7.8.2. Recursive Queries](queries-with.md#queries-with-recursive) - [7.8.3. Common Table Expression Materialization](queries-with.md#queries-with-cte-materialization) - [7.8.4. Data-Modifying Statements in `WITH`](queries-with.md#queries-with-modifying) - [7.9. Graph Queries](queries-graph.md) - [7.9.1. Overview](queries-graph.md#queries-graph-overview) - [7.9.2. Graph Patterns](queries-graph.md#queries-graph-patterns) The previous chapters explained how to create tables, how to fill them with data, and how to manipulate that data. Now we finally discuss how to retrieve the data from the database.