2
返回属性不包含特定字符的xml序列
考虑以下简单的XML: <xml> <customer name="Max"> <email address="me@you.com" /> </customer> <customer name="Erik"> <email address="erik@your-mom.com" /> </customer> <customer name="Brent"> <email address="brentcom" /> </customer> </xml> 我想获取<Customer>序列列表,其中address该<email>项目的属性不包含@。 所以,我想要的输出看起来像: <customer name="Brent"> <email address="brentcom" /> </customer> mcve: DECLARE @x XML = '<xml> <customer name="Max"><email address="me@you.com" /></customer> <customer name="Erik"><email address="erik@your-mom.com" /></customer> <customer name="Brent"><email address="brentcom" /></customer> </xml>'; 该查询: SELECT …
10
sql-server
xml
xquery