pivot-xml

pivot XML parsing

独自空忆成欢 提交于 2021-02-11 13:56:48
问题 I have problem exactly like the post: Parse xmltype into table after pivot xml I want to use pivot xml and then parse the xml (maybe with xmltable function) to table. What can I do if I don't know the countries name and how many countries exist? Thanks! 来源: https://stackoverflow.com/questions/62794756/pivot-xml-parsing

Convert Pivot xml output to tabular output without xml

空扰寡人 提交于 2019-12-11 04:08:17
问题 I have following kind of table: ID | Key | Value -- --- ----- 1 A aa 2 B bb 3 A ay 4 C cc 5 B bx 6 C ct I need the output : A B C --- --- --- aa bb cc ay bx ct When I use PIVOT with subquery it does not work: Select * from (Select Key, Value, Id from tableName pivot (max(Value) for Key IN (SELECT distinct Key from tableName))); If I use PIVOT xml, the subquery works: Select * from (Select Key, Value, Id from tableName) pivot xml (max(Value) for Key IN (SELECT distinct Key from tableName));