I have a table with a Varchar
column with the value as mentioned below. How can i parse this string into columns
This string in a column
<item id="1" value="1"><item id="2" value="6"><item id="4" value="8">
into
Item ID value
--------------
1 1
2 6
4 8
1条答案
按热度按时间fafcakar1#
Your data resembles XML fragment. And it is not well-formed.
All what you need is to compose XML on the fly. After that XQuery makes it very easy (as @Larnu pointed out it already). No need to parse anything.
SQL
Output