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

SQL 服務器 xquery

SQL server xquery(SQL 服務器 xquery)
本文介紹了SQL 服務器 xquery的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個 xml 數據

I have a xml data

<Education>

          <School ID="1">
          <Degree>test</Degree>
          <Description>desc1</Description>
          <Institution>kec</Institution>
          </School>

          <School ID="2">
          <Degree>test2</Degree>
          <Description>desc2</Description>
          <Institution>kec2</Institution>
             </School>

      </Education>

現在我需要將學校的詳細信息提取到一些臨時表中

now I need to extract the School detail into some temp table

喜歡

----------------------------------
schoolid degree desc instituion
----------------------------------
1        test    desc1  kec
2        test2   desc2  kec2

誰能幫幫我

推薦答案

使用:

declare @x xml='<Education>

          <School ID="1">
          <Degree>test</Degree>
          <Description>desc1</Description>
          <Institution>kec</Institution>
          </School>

          <School ID="2">
          <Degree>test2</Degree>
          <Description>desc2</Description>
          <Institution>kec2</Institution>
             </School>

      </Education>'


select t.s.value('@ID', 'int') [schoolid]
    , t.s.value('Degree[1]', 'nvarchar(20)') [degree]
    , t.s.value('Description[1]', 'nvarchar(20)') [desc]
    , t.s.value('Institution[1]', 'nvarchar(20)') [instituion]
from @x.nodes('Education/School') t(s)

輸出:

schoolid    degree               desc                 instituion
----------- -------------------- -------------------- --------------------
1           test                 desc1                kec
2           test2                desc2                kec2

這篇關于SQL 服務器 xquery的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

Converting Every Child Tags in to a Single Column with multiple Delimiters -SQL Server (3)(將每個子標記轉換為具有多個分隔符的單列-SQL Server (3))
How can I create a view from more than one table?(如何從多個表創建視圖?)
Create calculated value based on calculated value inside previous row(根據前一行內的計算值創建計算值)
How do I stack the first two columns of a table into a single column, but also pair third column with the first column only?(如何將表格的前兩列堆疊成一列,但也僅將第三列與第一列配對?) - IT屋-程序員軟件開發技
Recursive t-sql query(遞歸 t-sql 查詢)
Convert Month Name to Date / Month Number (Combinations of Questions amp; Answers)(將月份名稱轉換為日期/月份編號(問題和答案的組合))
主站蜘蛛池模板: 岛国av在线免费观看 | 91麻豆精品国产91久久久久久 | 亚洲国产精品视频 | 亚洲精品一区在线观看 | 久久69精品久久久久久国产越南 | 欧美一区二区三区高清视频 | 亚洲网站在线观看 | 秋霞性生活 | 午夜精品久久 | 国产在线精品一区二区三区 | 九九九视频 | jlzzjlzz欧美大全 | 在线视频成人 | 国产免费播放视频 | 成人不卡在线 | 亚洲国产精品一区 | 黄色大片免费网站 | 欧美黄色一区 | 国产视频精品视频 | 亚洲免费网址 | 亚洲免费在线 | 中文字幕成人在线 | 国产激情自拍视频 | 久久lu| 国产午夜精品一区二区三区在线观看 | 欧美精品一区二区在线观看 | 国产欧美精品一区二区 | 久久33| 真人女人一级毛片免费播放 | av国产精品毛片一区二区小说 | 日本在线视频一区二区 | 国产一级在线 | 久色| 欧美成年人视频在线观看 | 99精品亚洲国产精品久久不卡 | 午夜精品一区二区三区在线视频 | 亚洲精品久久久久中文字幕二区 | 波多野结衣一区二区 | www.午夜| 国产亚洲精品久久久久久豆腐 | 欧美日韩午夜精品 |