Suppose I have two tables:
- Code: Select all Expand viewCollapse view
my_table
┌──────┐
│ data │
├──────┤
│ 1 │
│ 2 │
│ 3 │
└──────┘
my_second_table
┌─────────────┐
│ column_name │
├─────────────┤
│ foo │
└─────────────┘
This is a pseudo-SQL query (giving a syntax error):
- Code: Select all Expand viewCollapse view
SELECT "data" AS ( SELECT "column_name" FROM "my_second_table" ) FROM "my_table"
The result I'd like to get is the value foo as header of the column:
- Code: Select all Expand viewCollapse view
╒═════╕
│ foo │
╞═════╡
│ 1 │
│ 2 │
│ 3 │
└─────┘
How can I obtain this?
I'm using HSQLDB version 1.8.