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

  • <small id='umV96'></small><noframes id='umV96'>

    <tfoot id='umV96'></tfoot>

      • <bdo id='umV96'></bdo><ul id='umV96'></ul>

        <legend id='umV96'><style id='umV96'><dir id='umV96'><q id='umV96'></q></dir></style></legend>
      1. <i id='umV96'><tr id='umV96'><dt id='umV96'><q id='umV96'><span id='umV96'><b id='umV96'><form id='umV96'><ins id='umV96'></ins><ul id='umV96'></ul><sub id='umV96'></sub></form><legend id='umV96'></legend><bdo id='umV96'><pre id='umV96'><center id='umV96'></center></pre></bdo></b><th id='umV96'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='umV96'><tfoot id='umV96'></tfoot><dl id='umV96'><fieldset id='umV96'></fieldset></dl></div>
      2. 使用 XQuery 獲取這些數(shù)據(jù)

        Use XQuery to get at this data(使用 XQuery 獲取這些數(shù)據(jù))

          <tbody id='CIUXS'></tbody>

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

            <tfoot id='CIUXS'></tfoot>
          1. <legend id='CIUXS'><style id='CIUXS'><dir id='CIUXS'><q id='CIUXS'></q></dir></style></legend>

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

                  本文介紹了使用 XQuery 獲取這些數(shù)據(jù)的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  我是 XQuery 的新手,但遇到了一些問題.這是我的例子.

                  I am new to XQuery and am having some problems with it. Here is my example.

                  我有這個(gè)變量:

                  declare @xmlDoc XML
                  

                  其中存儲(chǔ)了以下 xml:

                  it has the following xml stored in it:

                  <?xml version="1.0" encoding="utf-8"?>
                  <NewDataSet>
                    <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
                      <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:Locale="">
                        <xs:complexType>
                          <xs:choice minOccurs="0" maxOccurs="unbounded">
                            <xs:element name="Table1">
                              <xs:complexType>
                                <xs:sequence>
                                  <xs:element name="Sharedparam" type="xs:string" minOccurs="0" />
                                  <xs:element name="Antoher" type="xs:string" minOccurs="0" />
                                  <xs:element name="RandomParam2" type="xs:string" minOccurs="0" />
                                  <xs:element name="MoreParam" type="xs:string" minOccurs="0" />
                                  <xs:element name="ResultsParam" type="xs:string" minOccurs="0" />
                                </xs:sequence>
                              </xs:complexType>
                            </xs:element>
                          </xs:choice>
                        </xs:complexType>
                      </xs:element>
                    </xs:schema>
                    <Table1>
                      <Sharedparam>shared</Sharedparam>
                      <Antoher>sahre</Antoher>
                      <RandomParam2>Good stuff</RandomParam2>
                      <MoreParam>and more</MoreParam>
                      <ResultsParam>2</ResultsParam>
                    </Table1>
                    <Table1>
                      <Sharedparam>Hey</Sharedparam>
                      <Antoher>what </Antoher>
                      <RandomParam2>do you</RandomParam2>
                      <MoreParam>think</MoreParam>
                      <ResultsParam>2</ResultsParam>
                    </Table1>
                    <Table1 />
                  </NewDataSet>
                  

                  如何選擇 Sharedparam 的所有值?(或者真的任何返回值(不是 xml)的體面的查詢都會(huì)很棒.)

                  How can I select all the values of Sharedparam? (Or really any decent query that returns values (not xml) would be great.)

                  我真正想做的是得到這樣的結(jié)果集:

                  What I am really looking to do is get a result set like this:

                  Name             Value1          Value2          Value3        Value4
                  Sharedparam      shared          Hey             Null          Null
                  Another          share           what            Null          Null
                  ....
                  

                  這會(huì)讓我忽略Value4"之外的任何數(shù)據(jù)(這對(duì)于我使用這些數(shù)據(jù)是可以接受的).

                  This would have me ignoring any data beyond "Value4" (and that is acceptable for my use of this data).

                  推薦答案

                  試試這個(gè):

                  SELECT
                      TBL.SParam.value('(.)[1]', 'varchar(50)')
                  FROM
                      @xmldoc.nodes('/NewDataSet/Table1/Sharedparam') AS TBL(SParam)
                  

                  給我一??個(gè)輸出:

                  (No column name)
                  shared
                  Hey
                  

                  更新:如果您想獲得 <Table1> 元素中的所有 XML 元素及其值,您可以使用這個(gè) XQuery:

                  Update: if you want to get at all the XML elements and their values inside the <Table1> elements, you can use this XQuery:

                  SELECT
                      TBL.SParam.value('local-name(.)[1]', 'varchar(50)') 'Attribute',
                      TBL.SParam.value('(.)[1]', 'varchar(50)') 'Value'
                  FROM
                      @xmldoc.nodes('/NewDataSet/Table1/*') AS TBL(SParam)
                  

                  輸出:

                  Attribute            Value
                  Sharedparam          shared
                  Antoher              sahre
                  RandomParam2         Good stuff
                  MoreParam            and more
                  ResultsParam         2
                  Sharedparam          Hey
                  Antoher              what 
                  RandomParam2         do you
                  MoreParam            think
                  ResultsParam         2
                  

                  更新 #2: 獲取第一個(gè) 和第二個(gè) XML 節(jié)點(diǎn)旁邊的值彼此之間,您需要對(duì) .nodes() 進(jìn)行兩次調(diào)用 - 一次檢索第一個(gè)節(jié)點(diǎn),另一次檢索第二個(gè).它有點(diǎn)毛茸茸的,特別是如果你想進(jìn)一步擴(kuò)展它 - 性能會(huì)很糟糕 - 但它有效:-)

                  Update #2: to get the values of the first <Table1> and the second <Table1> XML node next to one another, you need to do two calls to .nodes() - once retrieving the first node, the other time the second one. It gets a bit hairy, especially if you want to extend that even further - and performance is going to be abysmal - but it works :-)

                  SELECT
                      TBL.SParam.value('local-name(.)[1]', 'varchar(50)') 'Attribute',
                      TBL.SParam.value('(.)[1]', 'varchar(50)') 'Value 1',
                      TBL2.SParam2.value('(.)[1]', 'varchar(50)') 'Value 2'
                  FROM
                      @xmldoc.nodes('/NewDataSet/Table1[1]/*') AS TBL(SParam)
                  INNER JOIN
                      @xmldoc.nodes('/NewDataSet/Table1[2]/*') AS TBL2(SParam2) ON TBL.SParam.value('local-name(.)[1]', 'varchar(50)') = TBL2.SParam2.value('local-name(.)[1]', 'varchar(50)')
                  

                  給出以下輸出:

                  Attribute      Value 1     Value 2
                  Sharedparam    shared       Hey
                  ResultsParam      2          2
                  RandomParam2   Good stuff   do you
                  Antoher        sahre        what 
                  MoreParam      and more     think
                  

                  這篇關(guān)于使用 XQuery 獲取這些數(shù)據(jù)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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 實(shí)例使用的空間嗎?) - IT屋-程序員軟件開發(fā)
                  How to create a login to a SQL Server instance?(如何創(chuàng)建對(duì) SQL Server 實(shí)例的登錄?)
                  How to know the version and edition of SQL Server through registry search(如何通過注冊(cè)表搜索知道SQL Server的版本和版本)
                  Why do I get a quot;data type conversion errorquot; with ExecuteNonQuery()?(為什么會(huì)出現(xiàn)“數(shù)據(jù)類型轉(zhuǎn)換錯(cuò)誤?使用 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è)計(jì)——將文檔從 SQL Server 移動(dòng)到文件存儲(chǔ))
                    <tbody id='WfQZw'></tbody>
                  <legend id='WfQZw'><style id='WfQZw'><dir id='WfQZw'><q id='WfQZw'></q></dir></style></legend>
                  <i id='WfQZw'><tr id='WfQZw'><dt id='WfQZw'><q id='WfQZw'><span id='WfQZw'><b id='WfQZw'><form id='WfQZw'><ins id='WfQZw'></ins><ul id='WfQZw'></ul><sub id='WfQZw'></sub></form><legend id='WfQZw'></legend><bdo id='WfQZw'><pre id='WfQZw'><center id='WfQZw'></center></pre></bdo></b><th id='WfQZw'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='WfQZw'><tfoot id='WfQZw'></tfoot><dl id='WfQZw'><fieldset id='WfQZw'></fieldset></dl></div>

                  1. <tfoot id='WfQZw'></tfoot>
                      <bdo id='WfQZw'></bdo><ul id='WfQZw'></ul>

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

                            主站蜘蛛池模板: 91人人视频在线观看 | 欧美日韩一区二区三区视频 | 特级黄一级播放 | 亚洲精品在线看 | 久久久久久影院 | 久草久草久草 | 国产高清在线观看 | 日韩免费| 国产成人久久精品一区二区三区 | 中文在线a在线 | 视频在线亚洲 | 伊色综合久久之综合久久 | 色综合99| 国产一级视频在线播放 | 国产亚洲第一页 | 91免费看片| 亚洲一区二区三区免费视频 | 羞羞视频免费观看入口 | 超碰97人人人人人蜜桃 | 精品99在线 | 红桃视频一区二区三区免费 | 高清视频一区二区三区 | h视频在线观看免费 | 黄色在线免费观看 | 日日夜夜精品视频 | 91精品国产综合久久精品图片 | 国产在线成人 | 日韩一级一区 | 91玖玖| 成人影院一区二区三区 | 久久99精品久久久 | 久久国产欧美一区二区三区精品 | 久草视频在 | 国产欧美在线播放 | 日韩欧美国产一区二区 | 美女一区二区在线观看 | 欧美一区二区免费 | 久久久精品一区 | 91久久久久 | 欧美高清一区 | av在线三级|