Quering data

The SELECT clause

A SELECT statement retrieves zero or more rows from one or more database tables or database views. [1]

The Select object builds a SELECT statement that can be executed in a database by using a SelectStatement instance. The SelectStatement only retrieves data from the database and has no persistent effects on the database.

Some essential Select methods:

Synopsis

interface Select

The WITH clause

The WITH clause was introduced in standard SQL to simplify complex queries, especially those with JOINs and subqueries. A WITH clause defines a temporary data set whose output is available to be referenced in subsequent queries. [2]

The With object (Common Table Expressions)

You can specify common table expressions using a WITH clause that has one or more Select subclauses

Synopsis

interface With