Oracle XML Nested query

Source: Internet
Author: User

The XML structure is as follows:

< Frequency Division Division name = "2013_01freqband137_137p025m" display ratio = "0.530348" >

< Business Set >

< Business Primary= "1" owlcode= "Radioserviceextra2_m21" >

< footnote list >

< footnotes >5.55</ footnotes >

< footnotes >5.56</ footnotes >

</ footnote list >

</ Business >

< Business Primary= "1" owlcode= "spaceservice1_m2" >

< footnote list >

< footnotes >5.57</ footnotes >

</ footnote list >

</ Business >

< Business Primary= "1" owlcode= "Spaceservice_o4" >

< footnote list >

< footnotes >5.58</ footnotes >

</ footnote list >

</ Business >

< Business Primary= "1" owlcode= "SPACESERVICE_R3" >

< footnote list >

< footnotes >5.59</ footnotes >

</ footnote list >

</ Business >

< Business Primary= "1" owlcode= "TERRESTRIALSERVICE_GD" >

< footnote list >

< footnotes >5.60</ footnotes >

</ footnote list >

</ Business >

< Business Primary= "1" owlcode= "Terrestrialservice_y2" >

< footnote list >

< footnotes >5.61</ footnotes >

</ footnote list >

</ Business >

</ Business Set >

< footnote list >

< footnotes >5.208</ footnotes >

</ footnote list >

</ Frequency Division >

Query " < Business > "in the Owlcode property and the " < footnote list > ", Query SQL as follows:

Select fa.freq_zone_id, Xt.owlcode owl_code,footnote

from Fs_freq_allocation_cn FA,

xmltable ( '/ " Span style= "font-family: Song body; Background-color:white "> frequency division / business set / business " passing Fa.freq_allocation_xml columns

Owlcode VARCHAR2() path' @owlcode ',

foot_xml xmltypepath' footnote list ') XT,

xmltable ( '/ " Span style= "font-family: Song body; Background-color:white "> footnote list / footnote " passing Xt.foot_xml columns

Footnote varchar2( ) path ' text () ') jz

where fa.is_latest_ver = ' 1 'and freq_zone_id = ' 137-137.025m-2013 ';

The query results are as follows:

1???? 137-137.025m-2013???? RADIOSERVICEEXTRA2_M21???? 5.55

2???? 137-137.025m-2013???? RADIOSERVICEEXTRA2_M21???? 5.56

3???? 137-137.025m-2013???? SPACESERVICE1_M2???? 5.57

4???? 137-137.025m-2013???? Spaceservice_o4???? 5.58

5???? 137-137.025m-2013???? SPACESERVICE_R3???? 5.59

6???? 137-137.025m-2013???? TERRESTRIALSERVICE_GD???? 5.60

7???? 137-137.025m-2013???? Terrestrialservice_y2???? 5.61

Oracle XML Nested query

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.