怎么根据xml列中的值来筛选
crate table test(col1 int,col2 xml)
select * from test where col2.query('/root/a[@b="true"]')
意思是这个意思 该怎么写
exists
?
select * from test where col2.exist('/root/a[@b="true"]')
???
select * from test where exists(select col2.query('e/b[@o="true"]') from test)
出来结果不对,出来的是全部行
xquery --->exist()
SQL code:
where col2.exist('/root/a/@b[. eq "true"]')=1
where col2.exist('/root/a/@b[xs:boolean(.) eq true()]')=1
谢谢,
相关问答:
请问各位大师,我现在需要将XML的数据实时的存入到数据库中,我是用asp编的程序,大量们帮忙分析 一下!!!
下面是我的XML文件代码
XML code:
<?xml version="1.0" encoding="utf-8"? ......
<?xml version="1.0" encoding="gb2312" ?>
<sites>
<site>
<name>.Net开发者园地</name>
<url>http://dotnet.aspx.cc</url>
<img&g ......
Java code:
/**
* 设置指定的元素名和节点索引所对应节点的内容
* @param 元素名
* @param 节点索引
* @param 内容
*/
public void setElementContent(String elementName,in ......
我现在做接口导出,.NET平台,开发语言C#,想导出XML的文本格式。
想得到 <?xml version="1.0" encoding="GBK"?>
的编码格式!怎么设置?谢谢!急!
顶
只要保存为xml格式, ......