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

  • <tfoot id='JwST9'></tfoot>
      <bdo id='JwST9'></bdo><ul id='JwST9'></ul>

      <legend id='JwST9'><style id='JwST9'><dir id='JwST9'><q id='JwST9'></q></dir></style></legend>

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

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

      1. FOR XML 通過樹概念中的屬性進行多重控制

        FOR XML multiple control by attribute in tree concept(FOR XML 通過樹概念中的屬性進行多重控制)

                <tbody id='1t00L'></tbody>

              <small id='1t00L'></small><noframes id='1t00L'>

            1. <i id='1t00L'><tr id='1t00L'><dt id='1t00L'><q id='1t00L'><span id='1t00L'><b id='1t00L'><form id='1t00L'><ins id='1t00L'></ins><ul id='1t00L'></ul><sub id='1t00L'></sub></form><legend id='1t00L'></legend><bdo id='1t00L'><pre id='1t00L'><center id='1t00L'></center></pre></bdo></b><th id='1t00L'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='1t00L'><tfoot id='1t00L'></tfoot><dl id='1t00L'><fieldset id='1t00L'></fieldset></dl></div>
              <legend id='1t00L'><style id='1t00L'><dir id='1t00L'><q id='1t00L'></q></dir></style></legend>
                  <bdo id='1t00L'></bdo><ul id='1t00L'></ul>
                • <tfoot id='1t00L'></tfoot>
                  本文介紹了FOR XML 通過樹概念中的屬性進行多重控制的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我想弄清楚一個問題.

                  我已經對簡單的訂購問題有疑問,但我想訂購更多詳細信息.在此鏈接下方檢查:SQL Server : FOR XML 按屬性排序控制

                  I already had question about simple ordering issue but I want to order more detail. check below this link : SQL Server : FOR XML sorting control by attribute

                  我做了一個例子.

                  SQL 查詢.

                  select (
                      select '123' AS '@id', ( 
                          select 
                          (
                              select 'test' AS '@testid' , '20' AS '@order'
                              FOR XML path ('tree') , TYPE
                          ),
                          (
                              select 'test2' AS '@testid' , '30' AS '@order'
                              FOR XML path ('tree-order') , TYPE
                          ),
                          (
                              select 'test' AS '@testid' , '10' AS '@order'
                              FOR XML path ('tree') , TYPE
                          )
                          FOR XML path ('Node') , TYPE
                      )
                      FOR XML path ('Sample') , TYPE
                      ),
                      (select '456' AS '@id', ( 
                          select 
                          (
                              select 'test' AS '@testid' , '20' AS '@order'
                              FOR XML path ('tree') , TYPE
                          ),
                          (
                              select 'test2' AS '@testid' , '30' AS '@order'
                              FOR XML path ('tree-order') , TYPE
                          ),
                          (
                              select 'test' AS '@testid' , '10' AS '@order'
                              FOR XML path ('tree') , TYPE
                          )
                          FOR XML path ('Node') , TYPE
                      )
                      FOR XML path ('Sample') , TYPE)
                  FOR XML path ('Main') , TYPE
                  

                  結果:

                  <Main>
                    <Sample id="123">
                      <Node>
                        <tree testid="test" order="20" />
                        <tree-order testid="test2" order="30" />
                        <tree testid="test" order="10" />
                      </Node>
                    </Sample>
                    <Sample id="456">
                      <Node>
                        <tree testid="test" order="20" />
                        <tree-order testid="test2" order="30" />
                        <tree testid="test" order="10" />
                      </Node>
                    </Sample>
                  </Main>
                  

                  預期結果:

                  <Main>
                    <Sample id="123">
                      <Node>
                        <tree testid="test" order="10" />
                        <tree testid="test" order="20" />
                        <tree-order testid="test2" order="30" />
                      </Node>
                    </Sample>
                    <Sample id="456">
                      <Node>
                        <tree testid="test" order="10" />
                        <tree testid="test" order="20" />
                        <tree-order testid="test2" order="30" />
                      </Node>
                    </Sample>
                  </Main>
                  

                  最終結果:

                  <Main>
                    <Sample id="123">
                      <Node>
                        <tree testid="test" />
                        <tree testid="test" />
                        <tree-order testid="test2" />
                      </Node>
                    </Sample>
                    <Sample id="456">
                      <Node>
                        <tree testid="test" />
                        <tree testid="test" />
                        <tree-order testid="test2" />
                      </Node>
                    </Sample>
                  </Main>
                  

                  這是按樹序排列的.

                  最后我不想在屬性中顯示訂單信息

                  finally I don't want to show order information in attribute

                  有人有好主意嗎?

                  感謝所有對此感興趣的人.

                  Thank you for everybody who interesting to this.

                  更新----------------------------------------

                  Updated ----------------------------------------

                  謝謝大家,最后我解決了以下關于 order by 和 remove 屬性問題的問題:

                  Thank you every body finally I solved problem as below about order by and remove attribute issue :

                  declare @resultData xml = (select @data.query('
                    element Main {
                      for $s in Main/Sample
                      return element Sample {
                        $s/@*,
                        for $n in $s/Node
                        return element Node {
                          for $i in $n/* 
                          order by $i/@order
                          return $i 
                        }
                      }  
                    }'));
                  
                    SET @resultData.modify('delete (Main/Sample/Node/tree/@order)');
                    SET @resultData.modify('delete (Main/Sample/Node/tree-order/@order)');
                  
                    select @resultData
                  

                  推薦答案

                  select @data.query('
                    element Main {
                      for $s in Main/Sample
                      return element Sample {
                        $s/@*,
                        for $n in $s/Node
                        return element Node {
                          for $i in Node/* 
                          order by $i/@order
                          return 
                            if ($i/self::tree)
                            then element tree { $i/@testid }
                            else element tree-order { $i/@testid }
                          }
                        }
                      }  
                    }')
                  

                  這篇關于FOR 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?)
                  <legend id='MMdsx'><style id='MMdsx'><dir id='MMdsx'><q id='MMdsx'></q></dir></style></legend>
                    <bdo id='MMdsx'></bdo><ul id='MMdsx'></ul>

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

                          <tbody id='MMdsx'></tbody>

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

                            主站蜘蛛池模板: 自拍偷拍亚洲视频 | 色婷婷综合网 | 欧洲一级毛片 | 亚洲欧美一区二区三区1000 | 亚洲欧洲精品成人久久奇米网 | 亚洲成人免费视频 | 欧美一级在线 | 亚洲一区二区在线播放 | 天天草天天爱 | 国产成人免费 | 精品国产一区久久 | 久艹av | 久热久草 | 中文字幕国产视频 | 91精品国产一区二区三区 | 一区二区三区欧美在线 | 中文福利视频 | 亚洲精品一区二区三区蜜桃久 | 免费一区二区三区在线视频 | 久久成人av电影 | 午夜免费在线观看 | 久久精品国产一区二区电影 | 亚洲国产一区二区视频 | 亚洲美女一区 | 国产高清在线观看 | 久久aⅴ乱码一区二区三区 亚洲欧美综合精品另类天天更新 | 亚洲一区中文字幕 | 欧美视频免费在线 | 在线国产一区 | 日韩精品一区在线 | 九色综合网 | 国产特级毛片aaaaaa | 国产免费福利在线 | 精品久久久久香蕉网 | 人人精品| 黄网站免费在线看 | ww亚洲ww亚在线观看 | 在线观看亚洲精品 | 91视频一区二区三区 | 插插宗合网 | www亚洲精品 |