I have a View named "VW_COLUMN_NAMES" created that has names of columns. It is dynamic. So the number or rows in this view changes depending on the query result.
I want to use the values from this view and create another view lets say "VW_OUTPUT" with column names that is return from the selection of "VW_COLUMN_NAMES". How can I do that?
VIEW: VW_COLUMN_NAMES has a column named "COLUMN_NAMES" with 3 rows
I want to create a dynamic View based on this View and create another view lets say "VW_OUTPUT"
CREATE OR REPLACE VIEW VW_OUTPUT AS
SELECT NAME, AGE, LOCATION FROM TEST_TABLE ...........
The number of columns in the above selection list should change based on the number of rows in VW_COLUMN_NAMES.
Please help.Thank you