Skip to content
Advertisement

SELECT VALUES in Teradata

I know that it’s possible in other SQL flavors (T-SQL) to “select” provided data without a table. Like:

SELECT *
FROM (VALUES (1,2), (3,4)) tbl

How can I do this using Teradata?

Advertisement

Answer

Teradata has strange syntax for this:

select t.*
from (select * from (select 1 as a, 2 as b) x
      union all
      select * from (select 3 as a, 4 as b) x
     ) t;
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement