【发布时间】:2014-05-07 15:41:16
【问题描述】:
我有一个带有 xml 列的 SQL Server 表。 xml 列有以下 xml 数据。
<organisation>
<organisation id="1"> <p> Content by Interviewee1 </p1> <p> Interviewee1 is talking about organisation-1 </p1> </organisation>
<organisation id="2"> <p> Content by Interviewee2 </p1> <p> Interviewee2 is talking about organisation-2 </p1> </organisation>
<organisation id="1"> <p> Content by Interviewee3 </p1> <p> Interviewee3 is talking about organisation-1 </p1> </organisation>
</organisation>
我需要按组织 ID 过滤。例如,如果我按 Id = 1 过滤,则预期会出现以下 xml。
<organisation>
<organisation id="1"> <p> Content by Interviewee1 </p1> <p> Interviewee1 is talking about organisation-1 </p1> </organisation>
<organisation id="1"> <p> Content by Interviewee3 </p1> <p> Interviewee3 is talking about organisation-1 </p1> </organisation>
</organisation>
【问题讨论】:
-
您的意思是您需要过滤
SELECT还是尝试实际更新列并在此过程中过滤XML? -
我需要过滤。当有人说,获取组织 id = 1 的所有面试时,我需要获取组织 id = 1 的面试数据。
标签: sql xml sql-server-2005 sqlxml