In the SELECT statement, the VALUES sub-clause of the FROM clause allows the specification of a set of constants to be used to form a finite set of rows. (Snowflake SQL Language Reference VALUES)
-- single row, without a table alias>VALUES ("one", 1); one 1-- Multiple rows, one column>VALUES1, 2, 3;123-- three rows with a table alias>SELECT data.a, bFROMVALUES ('one', 1), ('two', 2), ('three', NULL) ASdata(a, b); one 1 two 2 three NULL-- complex types with a table alias>SELECT a, bFROMVALUES ('one', array(0, 1)), ('two', array(2, 3)) ASdata(a, b); one [0, 1] two [2, 3]-- Using the SELECT syntax>SELECT'one', 2 one 2
c
3
1
2
4
Snowflake
-- single row, without a table aliasSELECT*FROM (VALUES ('one', 1));-- Multiple rows, one columnSELECT*FROM (VALUES (1), (2), (3));-- three rows with a table aliasSELECT a, bFROM (VALUES ('one', 1), ('two', 2), ('three', NULL)) ASdata(a, b);-- complex types with a table aliasSELECT a, b FROM (VALUES ('one', '[0, 1]'), ('two', '[2, 3]') ) ASdata(a, b);-- Using the SELECT syntaxSELECT'one', 2