怎么根据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中的值装到.txt格式的文件中。
我目前想到两种比较笨的方法:1.可以通过xmlspy编辑工具实现
2.通过把xml转成Javabean,然后转到excel中,再从新保存重命名为. ......
<?xml version="1.0" encoding="utf-8" ?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical&q ......
采用DOM 进行解析xml。要求将xml字串插入指定节点作为其子节点
比如:
原xml
<root>
</root>
要插入的xml字串
<a>test</a>
目的xml:
<root>
<a> ......