colpivot
colpivot copied to clipboard
Returning the select statement or temp table vs. void
I am trying to use this package, but I am running into complications.
Mainly, the colpivot function returns multiple results. Is there a way to isolate the results that are returned?
i.e if I do this...
select colpivot(params) ---> returns temp_table
select * from temp_table
END TRANSACTION
It will return multiple results --- one for colpivot and one for the temp_table.
If I try this...
with cte as (SELECT colpivot(params), * from some_table
LEFT JOIN some_table on temp_table)
END TRANSACTION
It will not allow the left join because the table does not exist before the query begins.
The only thing I can think is to modify what is being returned from the function. However, I have no idea the return type because the columns are dynamic.
@adventurini Have you found any solution to this?