在oracle中,一个表有两个字段A,B,怎么样判断A字段的内容全部包含在B字段里面?内容的顺序不一定一致

比如:A字段的内容是abca,B字段的内容是abddca,这样就算A字段包含在B字段里面??这个应该怎么来操作啊??

第1个回答  2012-02-28
select t.* from table t where field1 like '%'||t.field2||'%'这种可以匹配比如
a,b,c,ab,bc,abc在字符串abc中,但是你说的那种满足不了,不好意思,能力有限
第2个回答  2012-03-01
select t.* from table t
where substr(field1,1,1) like '%'||t.field2||'%
and substr(field1,2,1) like '%'||t.field2||'%
and substr(field1,3,1) like '%'||t.field2||'%
and substr(field1,4,1) like '%'||t.field2||'%本回答被网友采纳
相似回答