I need to create a single dynamic select query for different tables in Netezza.
I get the list of columns for any table by using following query:
select * from _V_SYS_COLUMNS where TABLE_NAME='Table Name'
But I need to append all the values of Column ‘Column_Name’ separated by comma and store it into a variable:
var= col1,col2,....
And then I will pass this ‘var’ in select query to run it for different tables.
Note: I cannot use Select * because all the columns are not required.