SQL语句查询 xml 谢谢老大帮我写的例子哈...
declare @aa xml
set @aa='<r><f s=''aa'' e=''bb'' u=''cc''></f></r>'
SELECT T.row.value('@s', 'nvarchar(100)') AS serviceId ,
T.row.value('@e', 'nvarchar(100)') AS feedType ,
T.row.value('@u', 'nvarchar(100)') AS sourceType
FROM @aa.nodes('/r/f') AS T ( row
set @aa='<r><f s=''aa'' e=''bb'' u=''cc''></f></r>'
SELECT T.row.value('@s', 'nvarchar(100)') AS serviceId ,
T.row.value('@e', 'nvarchar(100)') AS feedType ,
T.row.value('@u', 'nvarchar(100)') AS sourceType
FROM @aa.nodes('/r/f') AS T ( row