怎么根据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
谢谢,
相关问答:
DataSet导出xml 批处理(循环)得怎么处理
XML文件
<A>
<B>
<C>
</C>
&nb ......
<XML>
<FLAG>1</FLAG>
<REASON></REASON>
<ADVERT><ADID>64</ADID><ADNAME>英皇娱乐四</ADNAME><ADCONTENT>内容一</ADCONTENT><ADT ......
在action中至少有4个方法,每个方法接受一种请求,例如四个方法最简单的就是增删改查,每一种操作,需要校验的action属性是不同的,校验属性的规则也是不同的,怎么样才能使用xml的输入校验?
如果是使用actionName ......
<?xml version="1.0" encoding="UTF-8"?>
<QUERYCONDITION recordsperpage="10">
<PREDICATE/>
<CONDITIONS>
<CONDITION>
<LOGIC> ......
采用DOM 进行解析xml。要求将xml字串插入指定节点作为其子节点
比如:
原xml
<root>
</root>
要插入的xml字串
<a>test</a>
目的xml:
<root>
<a> ......