Help with distinct output
Posted: Wed Aug 17, 2016 7:34 pm
Hi,
I've got an xml like the sample below
I need an XQuery to return any unique set of info values referenced within each item.
i.e (BLUE | BLUE GREEN | RED)
Any help would be greatly appreciated.
Thanks!
I've got an xml like the sample below
Code: Select all
<test1>
<test2>
<item1>
<refs>
<value>101</value>
</refs>
</item1>
<item2>
<refs>
<value>101</value>
</refs>
<refs>
<value>102</value>
</refs>
</item2>
<item3>
<refs>
<value>103</value>
</refs>
</item3>
<item4>
<refs>
<value>101</value>
</refs>
</item4>
<item5>
<refs>
<value>101</value>
</refs>
<refs>
<value>102</value>
</refs>
</item5>
<item6>
<refs>
<value>103</value>
</refs>
</item6>
</test2>
<test3>
</test3>
<info1 ref="101">BLUE</info1>
<info2 ref="102">GREEN</info2>
<info3 ref="103">RED</info3>
</test1>
i.e (BLUE | BLUE GREEN | RED)
Any help would be greatly appreciated.
Thanks!