Select DISTINCT attribute vlaues fom XMLTYPE column and...
kozandJun 22 2011 — edited Jul 4 2011Hello
I have spent whole day to find the solution with no success. PLEAS HELP !
The Problem :
1. I have table with xmlType column in this column is the following xml:
<revision>
<product id = 1>
<screw>
<img id = 1/>
</screw>
<screw>
<img id = 2/>
</screw>
</product>
<product id = 2>
<screw>
<img id = 1/>
</screw>
</product>
</revision>
I must select DISTINCT img IDs and then select/join them form relational table img (id(number), pic (blob) )
I can't find the solution to select distinct attribute values from XML!
I have tried this:
select extract(c.xml, 'revision/product/screw/img[not(@id=preceding-sibling::img/@id)]/@id') from TABLE c;