2
我是新来查询SQL Server 2005中的XML数据类型。任何人都可以帮我创建一个查询我的需求?这是我的专栏的一个场景。SQL Server 2005 XML查询
Column Name: Cabinet
/*Row 1 XML Data*/
<shelf>
<box>
<item type="pencil" color="blue"/>
<item type="pencil" color="red"/>
<item type="paper" color="white"/>
<item type="ribbon" color="red"/>
</box>
<shelf>
/*Row 2 XML Data*/
<shelf>
<item type="pencil" color="yellow"/>
<item type="can" color="blue"/>
<item type="scissor" color="yellow"/>
<shelf>
Desired Output:
4
3
我想统计“项目”节点的数量,而不管其类型为&颜色。提前致谢。
感谢,正是我需要的。 – hallie 2010-03-08 15:19:51
这是一个很好的例子! – 2010-04-29 15:20:15