2

我有一个 XML 列:

<xmlList> 
   <XMLEntity> 
      <sug>ACHER</sug>
   </XMLEntity>

  <XMLEntity> 
      <sug>DOA</sug>
   </XMLEntity>
</xmlList>

sug只能容纳一个枚举成员(或ACHERDOA。我想检查是否存在sug没有这些值之一。

通过这种方式,我只得到 sug 节点,它是枚举值之一:

SELECT XMLSERIALIZE(XMLQUERY ('//xmlList/XMLEntity/sug[.="ACHER"]' passing 
KTOVET ) as char large object) as XXX ,

XMLSERIALIZE(XMLQUERY ('//xmlList/XMLEntity/sug[.="DOA"]' passing 
KTOVET ) as char large object) as YYY   

FROM "TABLE" 

我想获取值不是枚举值之一的sug节点。可能的?如何获取其值为“ACHER”的 sug 节点?

4

1 回答 1

1
SELECT XMLSERIALIZE(XMLQUERY ('//xmlList/XMLEntity/sug[.!="ACHER" and .!="DOA"]'  
passing KTOVET ) as char large object) as XXX

FROM "TABLE" 
于 2014-11-18T08:03:40.087 回答