I think the answer to this question is “no”, but I’d like to confirm.
Based on the syntax diagram provided in the documentation for CREATE TABLE
, I guess that column-name
can only accept a string in CREATE TABLE table-name (column-name-0 COLTYPE-A, column-name-1 COL-TYPE-B
)`.
But suppose I started with this data:
types: varchar date integer
headers: "hello" "date" "value"
data: "a" 2024-JAN 0
data: "a" 2024-FEB 1
Then I might want to PIVOT it into the following:
types: varchar integer integer
headers: "hello" 2024-JAN 2024-FEB
data: "a" 0 1
without destroying the DATE
structure of the headers.
After all, perhaps later, I might want to UNPIVOT
this data back into the “row-long” format, and it would be nice to not have to reparse the date from a string back into a DATE
object?