易截截图软件、单文件、免安装、纯绿色、仅160KB

怎么根据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()

引用
crate table test(col1 int,col2 xml)

select * from test where col2.query('/root/a[@b="true"]')

意思是这个意思 该怎么写


SQL code:
where col2.exist('/root/a/@b[. eq "true"]')=1

where col2.exist('/root/a/@b[xs:boolean(.) eq true()]')=1


谢谢,


相关问答:

请问Java如何把xml转txt格式呢?

今天遇到一个问题,把xml中的值装到.txt格式的文件中。
我目前想到两种比较笨的方法:1.可以通过xmlspy编辑工具实现
  2.通过把xml转成Javabean,然后转到excel中,再从新保存重命名为. ......

java xml文题 - Java / Java SE

<?xml version="1.0" encoding="utf-8" ?> 
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical&q ......

[vc] 如何将XML字串插入到指定的Node

采用DOM 进行解析xml。要求将xml字串插入指定节点作为其子节点
比如: 
原xml 
<root>
</root>
要插入的xml字串
<a>test</a> 
目的xml:
<root>
<a> ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号