久久久久久久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 通過樹概念中的屬性進行多重控制的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我想弄清楚一個問題.

                  我已經(jīng)對簡單的訂購問題有疑問,但我想訂購更多詳細(xì)信息.在此鏈接下方檢查: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
                  

                  結(jié)果:

                  <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>
                  

                  預(yù)期結(jié)果:

                  <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>
                  

                  最終結(jié)果:

                  <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 ----------------------------------------

                  謝謝大家,最后我解決了以下關(guān)于 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 }
                          }
                        }
                      }  
                    }')
                  

                  這篇關(guān)于FOR XML 通過樹概念中的屬性進行多重控制的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  SQL query to get all products, categories and meta data woocommerce/wordpress(獲取所有產(chǎn)品、類別和元數(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ù)類型轉(zhuǎn)換錯誤?使用 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'>

                            主站蜘蛛池模板: 色眯眯视频在线观看 | 精品免费视频一区二区 | 欧美最猛性xxxxx亚洲精品 | 在线看91| 91精品久久久久久久99 | 日本亚洲精品成人欧美一区 | 国产精品一区二区三区久久 | 日韩一级免费看 | 成人久久 | 九九久久在线看 | 欧美一区二区在线播放 | 自拍偷拍中文字幕 | 精品日韩一区 | 99综合在线 | 成人国产精品免费观看视频 | 国产精品美女久久久av超清 | 一区二区精品在线 | 亚洲欧美在线一区 | 日本午夜一区二区三区 | 欧美色综合一区二区三区 | 日韩欧美国产精品一区二区三区 | av资源中文在线 | 午夜无码国产理论在线 | 国产成人精品999在线观看 | 精品一区国产 | 手机看片在线播放 | 精品福利在线视频 | 成人免费在线视频 | 国产精品视频在线观看 | 国产激情一区二区三区 | 国产 亚洲 网红 主播 | 成人黄色av网址 | 国产精品日韩欧美一区二区三区 | 91 在线| 日韩精品一区二区三区在线观看 | 国产精品日韩欧美一区二区 | 精品欧美一区免费观看α√ | 国产精品海角社区在线观看 | 久久久久久久久久久国产 | 日本aaa视频| 国产一区二区精品在线观看 |