Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

how to make a join in xml

$
0
0

I have below xml 

DECLARE @t TABLE ( 

ID INT IDENTITY, 

Data XML 


INSERT INTO @t (Data) 
SELECT '<ROOT>
<employeeinfo>
  <employee>
<employeeid>1</employeeid>
    <name>first</name>
    <Lname>lastname</Lname>
  </employee>
  <employee>
<employeeid>2</employeeid>
    <name>second</name>
    <Lname>lastname</Lname>
  </employee>
 </employeeinfo>
 <salaryinof>
<salary>
<employeeid>1</employeeid>
<amount>100</amount>
</salary>
<salary>
<employeeid>2</employeeid>
<amount>200</amount>
</salary>
<salary>
<employeeid>3</employeeid>
<amount>300</amount>
</salary>
 </salaryinof>
</ROOT>' 

and need output like this


vishnu dalwadi


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>