0

For the following "t" table, “name_set” is the name of its 3 columns. How can I write a SQL script to perform python-like unpacking as I want to select all the columns in “name_set”?

Zoey
  • 48
  • 5

1 Answers1

0

You can use meta-programming:

T=table(1..3 as id,2..4 as val1,3..5 as val2,4..6 as val3)
name_set=["val1","val2","val3"]

sql(sqlCol(name_set),T).eval()

Output:

val1    val2    val3
2   3   4
3   4   5
4   5   6
winnie
  • 183
  • 1
  • 6