VALUES

VALUES computes a set of rows.

Synopsis

  1. VALUES ( expression [, ...] ) [, ...]

Description

VALUES can be used to generate a result set containing constant values.

When more than 1 row is specified, all rows must have the same number of elements.

An example:

  1. cr> VALUES (1, 'one'), (2, 'two'), (3, 'three');
  2. +------+-------+
  3. | col1 | col2 |
  4. +------+-------+
  5. | 1 | one |
  6. | 2 | two |
  7. | 3 | three |
  8. +------+-------+
  9. VALUES 3 rows in set (... sec)

It is commonly used in INSERT to provide values to insert into a table.

All expressions within the same column must have the same type or its types can be implicitly converted.