I am working on Oracle. I have this large property-indexer table (THE_TABLE), whose columns are
[ObjectID | CategoryID | Property1 | Property2 | ... | PropertyN]
where N is known by design. All the Property% columns are VARCHAR2 of the same size, the ObjectID is Numeric. Now, I would like to create a materialized view that contains the results of the following queries:
select distinct CategoryID, (select 'Property1' from dual) as PropertyName, Property1 as PropertyValue from THE_TABLE
select distinct CategoryID, (select 'Property2' from dual) as PropertyName, Property2 as PropertyValue from THE_TABLE
...
select distinct CategoryID, (select 'PropertyN' from dual) as PropertyName, PropertyN as PropertyValue from THE_TABLE
In other words, the view (THE_VIEW) should contain three columns:
[CategoryID | PropertyName | PropertyValue]
and be able to return the unique values linked to a specific CategoryID. Is there a way to create such a view?
Please note that I do not have the possibility to modify THE_TABLE.
Regards,
Andrea
I am not sufe if I understand your question correctly, but I believe you want something like