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

  • <legend id='fn5Vd'><style id='fn5Vd'><dir id='fn5Vd'><q id='fn5Vd'></q></dir></style></legend>
    • <bdo id='fn5Vd'></bdo><ul id='fn5Vd'></ul>
    <tfoot id='fn5Vd'></tfoot>

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

        獲取嵌套的 XML 輸出 sql server

        Get nested XML output sql server(獲取嵌套的 XML 輸出 sql server)

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

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

                • 本文介紹了獲取嵌套的 XML 輸出 sql server的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我的 sql server 數(shù)據(jù)庫的 xml 輸出有問題.我的桌子:

                  I have a problem with my xml output from sql server database. My table:

                  CREATE TABLE [dbo].[test_table](
                      [id] [int] IDENTITY(1,1) NOT NULL,
                      [firstname] [nvarchar](255) NULL,
                      [lastname] [nvarchar](255) NULL,
                      [city] [nvarchar](255) NULL,
                      [street] [nvarchar](255) NULL,
                      [streetno] [int] NULL
                  )
                  

                  我想要輸出,其中 Address 嵌套在每個 Person 中,如下所示:

                  I want the output, where Address is nested inside each Person, like this:

                  <Root>
                    <Person id="1">
                      <firstname>Stefanie</firstname>
                      <lastname>Buckley</lastname>
                      <Address>
                        <city>Oklahoma</city>
                        <street> Cowley Road</street>
                        <streetno>34</streetno>
                      </Address>
                    </Person>
                    <Person id="2">
                      <firstname>Sandy</firstname>
                      <lastname>Mc Gee</lastname>
                      <Address>
                        <city>Montgomery</city>
                        <street> Hague Parkway</street>
                        <streetno>27</streetno>
                      </Address>
                    </Person>
                  </Root>
                  

                  我嘗試過嵌套選擇,例如:

                  I've tried with nested select like:

                   select tbl1.id '@id', tbl1.firstname, tbl1.lastname,
                   (
                   select city,street,streetno from test_table as tbl2
                   where tbl2.id = tbl1.id
                   for xml path('Address')
                   ) 
                   from test_table as tbl1
                   for xml path('Person'), Root('Root')
                  

                  但輸出如下:

                  <Root>
                    <Person id="1">
                      <firstname>Stefanie</firstname>
                      <lastname>Buckley</lastname>&lt;Address&gt;&lt;city&gt;Oklahoma&lt;/city&gt;&lt;street&gt; Cowley Road&lt;/street&gt;&lt;streetno&gt;34&lt;/streetno&gt;&lt;/Address&gt;</Person>
                    <Person id="2">
                      <firstname>Sandy</firstname>
                      <lastname>Mc Gee</lastname>&lt;Address&gt;&lt;city&gt;Anchorage&lt;/city&gt;&lt;street&gt; North Green Clarendon Road&lt;/street&gt;&lt;streetno&gt;29&lt;/streetno&gt;&lt;/Address&gt;</Person>
                    <Person id="3">
                  

                  我做錯了什么?

                  推薦答案

                  你忘記了 ,輸入,你不需要 wxtra 從表中讀取.

                  You forgot , type and you don't need wxtra reading from table.

                  select tbl1.id '@id'
                      , tbl1.firstname
                      , tbl1.lastname
                      , (
                          select city
                              , street
                              , streetno
                          for xml path('Address'), type
                      ) 
                  from test_table as tbl1
                  for xml path('Person'), type, Root('Root')
                  

                  這篇關于獲取嵌套的 XML 輸出 sql server的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關文檔推薦

                  SQL query to get all products, categories and meta data woocommerce/wordpress(獲取所有產品、類別和元數(shù)據(jù)的 SQL 查詢 woocommerce/wordpress)
                  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ù)類型轉換錯誤?使用 ExecuteNonQuery()?)
                  How to show an image from a DataGridView to a PictureBox?(如何將 DataGridView 中的圖像顯示到 PictureBox?)

                    <tbody id='UGjnZ'></tbody>

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

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

                            <tfoot id='UGjnZ'></tfoot>

                          1. 主站蜘蛛池模板: 国产一区二区在线免费观看 | 亚洲欧美精品国产一级在线 | 久久精品国产99国产精品 | 久久99精品久久久久久琪琪 | 福利久久| 亚洲一区二区在线播放 | 国产精品视频不卡 | 日韩午夜影院 | 欧美一二区 | 国产精品视频专区 | 天天射夜夜操 | 毛片免费看 | 天天做日日做 | 欧美日一区二区 | 自拍视频网 | 狠狠躁18三区二区一区 | 日韩av电影在线观看 | 亚洲精品视频二区 | 91精品久久久久久久久中文字幕 | 中文字幕一级毛片视频 | 涩涩视频网 | 午夜av成人 | 美女天天操 | 久久夜视频 | 日本高清视频在线播放 | 在线国产一区 | 久久久噜噜噜www成人网 | 成人av高清 | 欧美1区 | 自拍中文字幕 | 日日碰狠狠躁久久躁婷婷 | 国产视频亚洲视频 | www.国产精品| av在线天堂 | 日韩午夜场 | 日本免费黄色 | 欧美精品成人 | 日韩成人在线播放 | 韩日在线视频 | 久久人人网 | 久久久久久亚洲 |