SQL Select to return a static list of values?

Viewed 5114

Is there a way to perform a select and return a static list? Something like the following:

select * from ('CA', 'FB', 'FC')

It should return

CA
FB
FC
2 Answers

If you want each value on a separate row, you can use table constructor values():

select val
from (values ('CA'), ('FB'), ('FC')) as t(val)

Perhaps:

select 'CA'
union all
select 'FB'
union all
select 'FC'
Related