xml 查询
DECLARE @xml xml
set @xml='<Devs><lang name="VB.NET"/><lang name="C#.NET"/><lang name="Java" /><lang name="Javascript" /> <lang name="ASP.NET" /></Devs>'
SELECT lang = L.n.value('(.)','NVARCHAR(MAX)') FROM @xml.nodes('/Devs/lang/@name') L(n) WHERE L.n.value('(.)','NVARCHAR(MAX)') LIKE '%#%'
DECLARE @xml XML = '
<Devs>
<lang name="VB.NET"/>
<lang name="C#.NET"/>
<lang name="Java" />
<lang name="Javascript" />
<lang name="ASP.NET" />
</Devs>
'
SELECT COUNT(*) AS [Totals] FROM @xml.nodes('/Devs') L(n)
SELECT COUNT(*) AS [Totals] FROM @xml.nodes('/Devs/lang') L(n)
<Devs>
<lang name="VB.NET"/>
<lang name="C#.NET"/>
<lang name="Java" />
<lang name="Javascript" />
<lang name="ASP.NET" />
</Devs>
'
SELECT COUNT(*) AS [Totals] FROM @xml.nodes('/Devs') L(n)
SELECT COUNT(*) AS [Totals] FROM @xml.nodes('/Devs/lang') L(n)
把学习一种技术一直坚持下去。