sql - retrieving xml node from multiple raws -


i retreieved column using inner join on 2 tables:

select table_1.*, table_2.c table_1 inner join table_2 on charindex(table_2.a, table_1.b) > 0 , table_2.c=1 table_1.d '%xxx...%' 

one of column in above query type xml:

<column1> --------- <xml1> --------- <xml2> --------- <xml3> --------- . . . 

1.i want retrieve string each xml , display additional column in query (all xml structure identical)? thanks. lets xml follow:

<root>  <row>   <string>xxx...</string>  </row> </root> 

okay, assume column of table contain xml of below format.

<root>   <row>     <value>1</value>   </row> </root> 

then check below query.

select  b.id,        x.xmlcol.value('value[1]', 'int') [nodeval]    yourtable b cross apply b.actualxmlcol.nodes('/root/row') x(xmlcol); 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -