Skip to content

SELECT Statement#

The SELECT statement is used to query tables in some catalog.

Examples#

Evaluate a single expression.

1
SELECT 1 + 1;

Select all columns and rows from table T.

1
SELECT * FROM T;

Select columns a, b, and c from table T.

1
SELECT a, b, c FROM T;

Select columns, applying scalar functions foo and bar.

1
SELECT foo(a), bar(b) FROM T;

Count the number of rows whose column a is non-null.

1
SELECT COUNT(a) FROM T;

Count the number of rows in each group b.

1
SELECT COUNT(*), b FROM T GROUP BY b;

Work in Progress

The SQL Reference documents are a work in progress.