How to use regexp_like to not include a string.
951544Jul 24 2012 — edited Jul 26 2012My oracle version is 11g
table struct
A TABLE
NUM COMMENTS
1 HAPPY BIRTHDAY!CHECK .
2 HAPPY BIRTHDAY!complete CHECK.
3 HAPPY BIRTHDAY!CHECK complete.
4 TODAY IS A GOOD DAY.
B TABLE
NUM REGEX
1 [^\W*complete\W*]
2 today
use
select A.COMMENTS from A WHERE exists (select 1 from B where B.NUM = A.NUM AND regexp_like(A.COMMENTS, B.REGEX, 'i'));
case 1
get the records not include complete
case 2
get the records include today
should only use
WHERE REGEXP_LIKE ('02:HAPPY BIRTHDAY!complete CHECK.', 'complete', 'i');
can not use
WHERE NOT REGEXP_LIKE ('02:HAPPY BIRTHDAY!complete CHECK.', 'complete', 'i');
How to write the regex in table B record one?
Anyone got any suggestions?
more info that [^\W*complete\W*] can not do this.
帖子经 user13674298编辑过