SQL

Hierarchy:

Categories

Tags:

Updated 2023-03-16

VALUES lets you create an ad-hoc list.

SELECT * FROM (VALUES (1, 'A'), (, 'b'), (3, 'C')) AS foo (num, title)Code language: SQL (Structured Query Language) (sql)

returns:

numtitle
1A
2b
3C

It is nice to be able to make a VALUES list to pass in a list you want to filter by with a readable value and an ID for joining, then LEFT JOIN with the other tables to pull in the data you are interested in.

Docs for VALUES:

Related Posts