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

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

    1. <tfoot id='dpK4E'></tfoot>

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

          <bdo id='dpK4E'></bdo><ul id='dpK4E'></ul>
        <legend id='dpK4E'><style id='dpK4E'><dir id='dpK4E'><q id='dpK4E'></q></dir></style></legend>

      1. sql server 上的 XML 解析

        XML Parsing on sql server(sql server 上的 XML 解析)
          <i id='69mPn'><tr id='69mPn'><dt id='69mPn'><q id='69mPn'><span id='69mPn'><b id='69mPn'><form id='69mPn'><ins id='69mPn'></ins><ul id='69mPn'></ul><sub id='69mPn'></sub></form><legend id='69mPn'></legend><bdo id='69mPn'><pre id='69mPn'><center id='69mPn'></center></pre></bdo></b><th id='69mPn'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='69mPn'><tfoot id='69mPn'></tfoot><dl id='69mPn'><fieldset id='69mPn'></fieldset></dl></div>

          <small id='69mPn'></small><noframes id='69mPn'>

          <legend id='69mPn'><style id='69mPn'><dir id='69mPn'><q id='69mPn'></q></dir></style></legend>
            <bdo id='69mPn'></bdo><ul id='69mPn'></ul>

                  <tbody id='69mPn'></tbody>
                  <tfoot id='69mPn'></tfoot>
                1. 本文介紹了sql server 上的 XML 解析的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  如何以格式返回數據:

                  Column Name t01     t02     t03     t04
                  Data        c01     c02     c03     c04
                  
                  <orders xmlns="www address">
                      <order>
                          <order-date>2019-09-05</order-date>
                          <created-by>storefront</created-by>
                          <original-order-no>000001</original-order-no>
                          <currency>USD</currency>
                          <taxation>gross</taxation>
                          <invoice-no>0099999</invoice-no>
                          <custom-attributes>
                              <custom-attribute attribute-id="t01">c01</custom-attribute>
                              <custom-attribute attribute-id="t02">c02</custom-attribute>
                              <custom-attribute attribute-id="t03">c03</custom-attribute>
                              <custom-attribute attribute-id="t04">c04</custom-attribute>
                          </custom-attributes>    
                      </order>
                  </orders>
                  

                  推薦答案

                  從你的問題來看,有一點不清楚:輸出列的命名.

                  From your question there's one thing not clear: The naming of the output columns.

                  在您預期的輸出中,它們的名稱與它們的 attribute-id 一樣.但在您的評論中,聽起來像是您選擇了前 4 個屬性,而您想忽略其余屬性.

                  In your expected output they are named like their attribute-id. But in your comments it sounds, like you are picking the first 4 attributes and you want to omit the rest.

                  我想展示兩種方法,選擇你更喜歡的一種:

                  I want to show two approaches, pick the one you like more:

                  DECLARE @mockupTable TABLE(ID INT IDENTITY, YourXml XML);
                  INSERT INTO @mockupTable VALUES
                  (N'<orders xmlns="www address">
                      <order>
                          <order-date>2019-09-05</order-date>
                          <created-by>storefront</created-by>
                          <original-order-no>000001</original-order-no>
                          <currency>USD</currency>
                          <taxation>gross</taxation>
                          <invoice-no>0099999</invoice-no>
                          <custom-attributes>
                              <custom-attribute attribute-id="t01">c01</custom-attribute>
                              <custom-attribute attribute-id="t02">c02</custom-attribute>
                              <custom-attribute attribute-id="t03">c03</custom-attribute>
                              <custom-attribute attribute-id="t04">c04</custom-attribute>
                          </custom-attributes>    
                      </order>
                  </orders>');
                  

                  --此查詢將使用 attribute-id 選擇相應的屬性.
                  --我們可以使用相同的名稱安全地返回它
                  --如果你的XML沒有對應的屬性,就會出現NULL值

                  --This query will use the attribute-id to pick the corresponding attribute.
                  --We can savely return this with the same name
                  --If your XML does not have the corresponding attribute, there will be a NULL value

                  WITH XMLNAMESPACES(DEFAULT 'www address')
                  SELECT o.value('(order-date/text())[1]','date') OrderDate
                        --As in your other questions
                        ,o.value('(custom-attributes/custom-attribute[@attribute-id="t01"]/text())[1]','varchar(100)') AS t01 
                        ,o.value('(custom-attributes/custom-attribute[@attribute-id="t02"]/text())[1]','varchar(100)') AS t02
                        ,o.value('(custom-attributes/custom-attribute[@attribute-id="t03"]/text())[1]','varchar(100)') AS t03 
                        ,o.value('(custom-attributes/custom-attribute[@attribute-id="t04"]/text())[1]','varchar(100)') AS t04 
                  FROM @mockupTable t
                  CROSS APPLY t.YourXml.nodes('/orders/order') A(o);
                  

                  --這個比較容易.它只會選擇前四個屬性,無論它們有什么 id.

                  --This one is easier. It will pick just the first four attributes, no matter what id they have.

                  WITH XMLNAMESPACES(DEFAULT 'www address')
                  SELECT o.value('(order-date/text())[1]','date') OrderDate
                        --As in your other questions
                        ,o.value('(custom-attributes/custom-attribute[1]/text())[1]','varchar(100)') AS ca1 
                        ,o.value('(custom-attributes/custom-attribute[2]/text())[1]','varchar(100)') AS ca2
                        ,o.value('(custom-attributes/custom-attribute[3]/text())[1]','varchar(100)') AS ca3 
                        ,o.value('(custom-attributes/custom-attribute[4]/text())[1]','varchar(100)') AS ca4 
                  FROM @mockupTable t
                  CROSS APPLY t.YourXml.nodes('/orders/order') A(o);
                  

                  這篇關于sql server 上的 XML 解析的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  SQL query to get all products, categories and meta data woocommerce/wordpress(獲取所有產品、類別和元數據的 SQL 查詢 woocommerce/wordpress)
                  Can I figure out a list of databases and the space used by SQL Server instances without writing SQL queries?(我可以在不編寫 SQL 查詢的情況下找出數據庫列表和 SQL Server 實例使用的空間嗎?) - IT屋-程序員軟件開發
                  How to create a login to a SQL Server instance?(如何創建對 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()?(為什么會出現“數據類型轉換錯誤?使用 ExecuteNonQuery()?)
                  How to show an image from a DataGridView to a PictureBox?(如何將 DataGridView 中的圖像顯示到 PictureBox?)
                  <i id='AMGCa'><tr id='AMGCa'><dt id='AMGCa'><q id='AMGCa'><span id='AMGCa'><b id='AMGCa'><form id='AMGCa'><ins id='AMGCa'></ins><ul id='AMGCa'></ul><sub id='AMGCa'></sub></form><legend id='AMGCa'></legend><bdo id='AMGCa'><pre id='AMGCa'><center id='AMGCa'></center></pre></bdo></b><th id='AMGCa'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='AMGCa'><tfoot id='AMGCa'></tfoot><dl id='AMGCa'><fieldset id='AMGCa'></fieldset></dl></div>
                    <tbody id='AMGCa'></tbody>
                      • <bdo id='AMGCa'></bdo><ul id='AMGCa'></ul>

                            <tfoot id='AMGCa'></tfoot><legend id='AMGCa'><style id='AMGCa'><dir id='AMGCa'><q id='AMGCa'></q></dir></style></legend>

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

                            主站蜘蛛池模板: 日本在线免费看最新的电影 | 午夜电影在线播放 | 欧美成人a∨高清免费观看 欧美日韩中 | 欧美日韩国产传媒 | 夜夜草 | 国产欧美一区二区三区在线播放 | 免费观看一级特黄欧美大片 | 97久久精品午夜一区二区 | 国产高清一区二区三区 | 人人插人人| 久久尤物免费一区二区三区 | 亚洲精品视频在线观看视频 | 亚洲区一区二区 | 黄色片在线观看网址 | 日韩成人免费中文字幕 | 成人精品国产一区二区4080 | 国产精品久久久久久久久久久久 | 99久久日韩精品免费热麻豆美女 | 亚洲一区二区三区国产 | 成人在线观看欧美 | 成人精品一区二区三区 | 精品国产乱码久久久久久果冻传媒 | 亚洲精品中文字幕av | 一区二区精品电影 | 日本特黄a级高清免费大片 国产精品久久性 | 欧美日韩亚洲国产 | 久久国产精品-国产精品 | 日韩一区二区三区在线观看 | 亚洲国产精品成人综合久久久 | 国产精品中文 | 日韩久久网| 大学生a级毛片免费视频 | 久产久精国产品 | 中文无码日韩欧 | 成人h视频在线观看 | 久久久久久久久久久久久9999 | 国产一区二区三区在线 | 亚洲成人黄色 | 国产麻豆一区二区三区 | 日韩国产在线 | 91精品国产综合久久久久久丝袜 |