Sample Header Ad - 728x90

Transpose rows to column in postgresql

2 votes
1 answer
2595 views
The following query gives me a list of 1222 distinct columns:
select distinct column_name from information_schema.columns where table_name like 'fea_var%';
I want to create one base table which has all the 1222 rows from this query as columns. fea_var% tables are just empty tables with columns. So, the output should be an empty table with those 1222 columns.
Asked by Reshmi Nair (31 rep)
Dec 15, 2021, 07:31 PM
Last activity: Dec 16, 2021, 11:35 AM