The VALUES clause creates a fixed number of literal rows. In DuckDB, it works as a standalone query or as an inline relation in FROM, making small seed datasets and temporary join inputs easy to express. section 3.4.4
Use the tuple shape deliberately:
- VALUES (1, 2); produces one row with two columns. section 3.4.4
- VALUES (1, 2), (3, 4); produces multiple rows without extra wrapping parentheses. section 3.4.4
- VALUES ((1, 2), (3, 4)); produces one row whose two columns contain structured values. section 3.4.4
Name an inline relation
SELECT * FROM (VALUES (1, 'Row 1', now()), (2, 'Row 2', now()) ) t(id, name, arbitrary_column_name); section 3.4.4
SELECT *
FROM (VALUES
(1, 'Row 1', now()),
(2, 'Row 2', now())
) t(id, name, arbitrary_column_name);
Inspect a runnable inline table with named columns and mixed value types. section 3.4.4
