VALUES
VALUES constructs rows directly from expressions. It can be a standalone
query or supply input rows to another statement.
Example
Section titled “Example”VALUES (1, 'eu'), (2, 'us');This returns two rows, each containing an integer and a string.
Syntax
Section titled “Syntax”VALUES (expression [, ...]) [, ...];Use as query input
Section titled “Use as query input”Give a derived table and its columns names to reference the values in a query:
SELECT region, count(*) AS eventsFROM (VALUES (1, 'eu'), (2, 'us'), (3, 'eu')) AS input(id, region)GROUP BY regionORDER BY region;The result is eu: 2 and us: 1.
Insert values
Section titled “Insert values”For an existing table:
INSERT INTO events (id, region) VALUES (1, 'eu'), (2, 'us');