Discussion about this post

User's avatar
Jecc's avatar

Hold my beer:

select * from (values(2, 'foo'), (5, 'quux'), (7, 'gvar')) tmp(colA, colB);

Valid in SqlServer and PostgreSQL. SQLite won't let you name your columns, but you can get there via a CTE, or omit them entirely if you don't care (they'll be named column1, column2).

I don't know about other databases.

Expand full comment
1 more comment...

No posts