XQuery filter
Hello,
How to filter the node based on specif condition? I have this data in database table (ID int ,data XML)
<MyData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Summary>
<GeneralInfo>
<Name>Organization1</Name>
<Country>India</Country>
</GeneralInfo>
<List>
<Summary>
<P_Name>Merry</P_Name>
<Costing>200</Costing>
<DataList1>
<Data>
<Type1>R01</Type1>
<Type2>R02</Type2>
<Type3>R03</Type3>
<Type4>R04</Type4>
<Type5>R05</Type5>
</Data>
<Data>
<Type6>R06</Type6>
<Type7>R07</Type7>
<Type8>R08</Type8>
<Type9>R09</Type9>
</Data>
</DataList1>
<DataList2>
<Data>
<Type1>R10</Type1>
<Type2>R11</Type2>
<Type3>R12</Type3>
<Type4>R13</Type4>
<Type5>R14</Type5>
</Data>
<Data>
<Type6>R15</Type6>
<Type7>R16</Type7>
<Type8>R18</Type8>
<Type9></Type9>
<Type10></Type10>
</Data>
</DataList2>
</Summary>
<Summary>
<P_Name>John</P_Name>
<Costing>200</Costing>
<DataList1>
<Data>
<Type1>R18</Type1>
<Type2>R19</Type2>
<Type3>R20</Type3>
<Type4>R21</Type4>
<Type5>R22</Type5>
</Data>
<Data>
<Type6>R23</Type6>
<Type7>R24</Type7>
<Type8>R25</Type8>
<Type9>R26</Type9>
</Data>
</DataList1>
<DataList2>
<Data>
<Type1>R28</Type1>
<Type2>R29</Type2>
<Type3>R30</Type3>
<Type4>R31</Type4>
<Type5>R32</Type5>
</Data>
<Data>
<Type6>R33</Type6>
<Type7>R34</Type7>
<Type8>R35</Type8>
<Type9>R36</Type9>
<Type10>R37</Type10>
</Data>
</DataList2>
</Summary>
</List>
</Summary>
</MyData>
I have to filiter the data for Specific ID from the table and P_Name is John. I wish to retrive data for Type1 and Type6
How toacheve this with XQUERY?
Thanks
|