久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <legend id='9uVWh'><style id='9uVWh'><dir id='9uVWh'><q id='9uVWh'></q></dir></style></legend>

    <small id='9uVWh'></small><noframes id='9uVWh'>

    1. <tfoot id='9uVWh'></tfoot>

        <i id='9uVWh'><tr id='9uVWh'><dt id='9uVWh'><q id='9uVWh'><span id='9uVWh'><b id='9uVWh'><form id='9uVWh'><ins id='9uVWh'></ins><ul id='9uVWh'></ul><sub id='9uVWh'></sub></form><legend id='9uVWh'></legend><bdo id='9uVWh'><pre id='9uVWh'><center id='9uVWh'></center></pre></bdo></b><th id='9uVWh'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='9uVWh'><tfoot id='9uVWh'></tfoot><dl id='9uVWh'><fieldset id='9uVWh'></fieldset></dl></div>
          <bdo id='9uVWh'></bdo><ul id='9uVWh'></ul>

        使用 Xquery 透視復(fù)雜的 XML

        Pivot complex XML using Xquery(使用 Xquery 透視復(fù)雜的 XML)
        <legend id='RbrVf'><style id='RbrVf'><dir id='RbrVf'><q id='RbrVf'></q></dir></style></legend>

            • <tfoot id='RbrVf'></tfoot>

                <small id='RbrVf'></small><noframes id='RbrVf'>

                • <bdo id='RbrVf'></bdo><ul id='RbrVf'></ul>
                  <i id='RbrVf'><tr id='RbrVf'><dt id='RbrVf'><q id='RbrVf'><span id='RbrVf'><b id='RbrVf'><form id='RbrVf'><ins id='RbrVf'></ins><ul id='RbrVf'></ul><sub id='RbrVf'></sub></form><legend id='RbrVf'></legend><bdo id='RbrVf'><pre id='RbrVf'><center id='RbrVf'></center></pre></bdo></b><th id='RbrVf'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='RbrVf'><tfoot id='RbrVf'></tfoot><dl id='RbrVf'><fieldset id='RbrVf'></fieldset></dl></div>
                    <tbody id='RbrVf'></tbody>

                  本文介紹了使用 Xquery 透視復(fù)雜的 XML的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送ChatGPT賬號..

                  是否可以將以下 xml 轉(zhuǎn)換為以下結(jié)果集,或讓結(jié)構(gòu)盡可能接近它?它顯然可以有超過 1 個具有相似數(shù)據(jù)的項目,我剛剛對其進行了修剪,因此文件中只有項目 sku 987654.

                  Is it possible to pivot the following xml into the following result set, or get the structure as close to it as possible? It can obviously have more than 1 item with similar data, I have just trimmed it down so only item sku 987654 is in the file.

                  DECLARE @XML AS XML = '<data xsi:schemaLocation="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex catalog.xsd http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt dt.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:dt="http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt" major="6" minor="1" family="enfinity" branch="enterprise" build="2.6.6-R-1.1.59.2-20210714.2">
                  <item sku="987654">
                  <sku>987654</sku>
                  <category-links>
                  <category-link name="abc" domain="WhiteStuff-DE-WebCategories" default = "0" hotdeal = "0"/>
                  <category-link name="def" domain="WhiteStuff-DE-WebCategories" default = "1" hotdeal = "0"/>
                  <category-link name="ghi" domain="WhiteStuff-DE-WebCategories" default = "0" hotdeal = "0"/>
                  </category-links>
                  <images>
                  <primary-view image-view="FF" />
                  <image-ref image-view="FD" image-type="w150" image-base-name="FD.jpg" domain="WhiteStuff" />
                  <image-ref image-view="FF" image-type="ORI" image-base-name="FF.jpg" domain="WhiteStuff" />
                  </images>
                  <variations>
                  <variation-attributes>
                  <variation-attribute name = "size">
                  <presentation-option>default</presentation-option>
                  <custom-attributes>
                  <custom-attribute name="displayName" dt:dt="string" xml:lang="en-US">Size</custom-attribute>
                  <custom-attribute name="productDetailUrl" xml:lang="de-DE" dt:dt="string">123.co.uk</custom-attribute>
                  </custom-attributes>
                  </variation-attribute>
                  <variation-attribute name = "colour">
                  <presentation-option>colorCode</presentation-option>
                  <presentation-product-attribute-name>rgbColour</presentation-product-attribute-name>
                  <custom-attributes>
                  <custom-attribute name="displayName" dt:dt="string" xml:lang="en-US">Colour</custom-attribute>
                  <custom-attribute name="productDetailUrl" xml:lang="de-DE" dt:dt="string">456.co.uk</custom-attribute>
                  </custom-attributes>
                  </variation-attribute>
                  </variation-attributes>
                  </variations>
                  </item>
                  </data>
                  '
                  

                  這是我的起點:

                  ;WITH XMLNAMESPACES 
                  (
                      DEFAULT 'http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex',
                      'http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt' as dt
                  )
                  
                  SELECT n.value('@sku', 'nvarchar(max)') as [sku]
                  
                      --[category-link],
                      --[FD image],
                      --[FF image],
                      --[productDetailUrl DE],
                      --[productDetailUrl EN]
                  
                  FROM @XML.nodes('/data/item') as x(n);
                  

                  推薦答案

                  不太清楚如何區(qū)分語言:

                  It is not so clear how to distinguish between languages:

                  • [productDetailUrl DE]
                  • [productDetailUrl EN]

                  除此之外,請嘗試以下解決方案.它會讓你開始.

                  Other than that, please try the following solution. It will get you started.

                  SQL

                  DECLARE @XML AS XML = 
                  N'<?xml version="1.0"?>
                  <data xsi:schemaLocation="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex catalog.xsd http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt dt.xsd"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xmlns="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex"
                        xmlns:xml="http://www.w3.org/XML/1998/namespace"
                        xmlns:dt="http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt"
                        major="6" minor="1" family="enfinity" branch="enterprise"
                        build="2.6.6-R-1.1.59.2-20210714.2">
                      <item sku="987654">
                          <sku>987654</sku>
                          <category-links>
                              <category-link name="abc" domain="WhiteStuff-DE-WebCategories"
                                             default="0" hotdeal="0"/>
                              <category-link name="def" domain="WhiteStuff-DE-WebCategories"
                                             default="1" hotdeal="0"/>
                              <category-link name="ghi" domain="WhiteStuff-DE-WebCategories"
                                             default="0" hotdeal="0"/>
                          </category-links>
                          <images>
                              <primary-view image-view="FF"/>
                              <image-ref image-view="FD" image-type="w150"
                                         image-base-name="FD.jpg" domain="WhiteStuff"/>
                              <image-ref image-view="FF" image-type="ORI" image-base-name="FF.jpg"
                                         domain="WhiteStuff"/>
                          </images>
                          <variations>
                              <variation-attributes>
                                  <variation-attribute name="size">
                                      <presentation-option>default</presentation-option>
                                      <custom-attributes>
                                          <custom-attribute name="displayName" dt:dt="string"
                                                            xml:lang="en-US">Size</custom-attribute>
                                          <custom-attribute name="productDetailUrl"
                                                            xml:lang="de-DE" dt:dt="string">123.co.uk</custom-attribute>
                                      </custom-attributes>
                                  </variation-attribute>
                                  <variation-attribute name="colour">
                                      <presentation-option>colorCode</presentation-option>
                                      <presentation-product-attribute-name>rgbColour</presentation-product-attribute-name>
                                      <custom-attributes>
                                          <custom-attribute name="displayName" dt:dt="string"
                                                            xml:lang="en-US">Colour</custom-attribute>
                                          <custom-attribute name="productDetailUrl"
                                                            xml:lang="de-DE" dt:dt="string">456.co.uk</custom-attribute>
                                      </custom-attributes>
                                  </variation-attribute>
                              </variation-attributes>
                          </variations>
                      </item>
                  </data>';
                  
                  ;WITH XMLNAMESPACES 
                  (
                      DEFAULT 'http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex',
                      'http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt' as dt
                  )
                  
                  SELECT c.value('@sku', 'nvarchar(max)') as [sku]
                      , n.value('@name','VARCHAR(20)') AS [category-link]
                      , c.value('(images/image-ref[@image-view="FD"]/@image-base-name)[1]','VARCHAR(20)') AS [FD image]
                      , c.value('(images/image-ref[@image-view="FF"]/@image-base-name)[1]','VARCHAR(20)') AS [FF image]
                      , c.value('(variations/variation-attributes/variation-attribute/custom-attributes/custom-attribute[@xml:lang="de-DE"]/text())[1]','VARCHAR(20)') AS [productDetailUrl DE]
                      , c.value('(variations/variation-attributes/variation-attribute[@name="colour"]/custom-attributes/custom-attribute[@xml:lang="de-DE"]/text())[1]','VARCHAR(20)') AS [productDetailUrl EN]
                  FROM @XML.nodes('/data/item') as t(c)
                      CROSS APPLY t.c.nodes('category-links/category-link') AS t2(n);
                  

                  輸出

                  +--------+---------------+----------+----------+---------------------+---------------------+
                  |  sku   | category-link | FD image | FF image | productDetailUrl DE | productDetailUrl EN |
                  +--------+---------------+----------+----------+---------------------+---------------------+
                  | 987654 | abc           | FD.jpg   | FF.jpg   | 123.co.uk           | 456.co.uk           |
                  | 987654 | def           | FD.jpg   | FF.jpg   | 123.co.uk           | 456.co.uk           |
                  | 987654 | ghi           | FD.jpg   | FF.jpg   | 123.co.uk           | 456.co.uk           |
                  +--------+---------------+----------+----------+---------------------+---------------------+
                  

                  這篇關(guān)于使用 Xquery 透視復(fù)雜的 XML的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Can I figure out a list of databases and the space used by SQL Server instances without writing SQL queries?(我可以在不編寫 SQL 查詢的情況下找出數(shù)據(jù)庫列表和 SQL Server 實例使用的空間嗎?) - IT屋-程序員軟件開發(fā)
                  How to create a login to a SQL Server instance?(如何創(chuàng)建對 SQL Server 實例的登錄?)
                  How to know the version and edition of SQL Server through registry search(如何通過注冊表搜索知道SQL Server的版本和版本)
                  Why do I get a quot;data type conversion errorquot; with ExecuteNonQuery()?(為什么會出現(xiàn)“數(shù)據(jù)類型轉(zhuǎn)換錯誤?使用 ExecuteNonQuery()?)
                  How to show an image from a DataGridView to a PictureBox?(如何將 DataGridView 中的圖像顯示到 PictureBox?)
                  WinForms application design - moving documents from SQL Server to file storage(WinForms 應(yīng)用程序設(shè)計——將文檔從 SQL Server 移動到文件存儲)

                    <legend id='UR5HN'><style id='UR5HN'><dir id='UR5HN'><q id='UR5HN'></q></dir></style></legend>
                    <i id='UR5HN'><tr id='UR5HN'><dt id='UR5HN'><q id='UR5HN'><span id='UR5HN'><b id='UR5HN'><form id='UR5HN'><ins id='UR5HN'></ins><ul id='UR5HN'></ul><sub id='UR5HN'></sub></form><legend id='UR5HN'></legend><bdo id='UR5HN'><pre id='UR5HN'><center id='UR5HN'></center></pre></bdo></b><th id='UR5HN'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='UR5HN'><tfoot id='UR5HN'></tfoot><dl id='UR5HN'><fieldset id='UR5HN'></fieldset></dl></div>
                    <tfoot id='UR5HN'></tfoot>

                      <bdo id='UR5HN'></bdo><ul id='UR5HN'></ul>

                        <small id='UR5HN'></small><noframes id='UR5HN'>

                              <tbody id='UR5HN'></tbody>
                          1. 主站蜘蛛池模板: 天天爱天天操 | 亚洲精品乱码久久久久久9色 | 91九色婷婷 | 亚洲第一av | 久久影音先锋 | 欧美一级黑人aaaaaaa做受 | 成人精品啪啪欧美成 | 国产精品自在线 | 国产午夜精品一区二区三区四区 | 欧美精品一区三区 | 男人天堂国产 | 欧美在线a| 看片地址| 精品在线一区二区三区 | 成人国产精品久久 | 一级片免费网站 | 日本a∨精品中文字幕在线 亚洲91视频 | 伊人影院在线观看 | 国内精品免费久久久久软件老师 | 日本午夜免费福利视频 | 黄色免费在线网址 | 日本在线观看视频 | 超碰网址| 国产成人免费在线 | 毛片一级片| 久久精品二区亚洲w码 | 亚洲综合视频 | 久久久精 | 亚洲视频免费观看 | 国产精品极品美女在线观看免费 | 欧美日韩不卡合集视频 | av免费网站在线观看 | 91麻豆精品国产91久久久久久久久 | 99精品国产一区二区三区 | 九九色综合 | 成年女人免费v片 | 亚洲综合色视频在线观看 | 欧美日韩亚洲一区 | 9久久精品| 男人天堂久久 | 爱综合 |