I want to extract location id from give xml, and also want to put condition that extract it if location does exists.
<?xml version="1.0" encoding="UTF-8"?>
<id>1006221342207</id>
<name>Hitesh Modha</name>
<email>[email protected]</email>
<location>
<id>115440481803904</id>
<name>Ahmedabad, India</name>
</location>
I have tried :
SET location = ExtractValue(xml, '//locations//id');
SELECT ExtractValue(location, '//id');
but it is not working. Please help