Ani

Ani

  • 975
  • 680
  • 32k

Checking a xml node value in sql

May 26 2017 8:20 AM
Hi,
 
I have a table named Sales, there is a column as xmldata. xmldata is as below
 
 
<data>
<product>
<area>
<pincode>110001</pincode>
<state>delhi</state>
<country>india</country>
</area> 
</product>
</data>

<data>
<product>
<area>
<pincode>411004</pincode>
<state>pune</state>
<country></country>
</area>
</product>
</data>
 
 
in some records country is missing. please provide an sql query to check whether country is null or not
 
 
 
 

Answers (3)