contains(columnname, 'ABC')=0
this means search for the data which doesn’t contain word ‘ABC’
contains(columnname, 'ABC and XYZ')=0
contains(columnname, 'ABC or XYZ')=0
what do these 2 sql mean? I tested them, there’s no syntax error, but they didn’t work as I expected, the ‘and’ seems like an ‘or’, and ‘or’ seems like an ‘and’, could anyone help to explain this?
all doc found in google are for contains()>0, those’re not what I need.
thanks in advance.
According to oracle documentation, the
containsfunction :If you ask for
You actually ask for a score of
0which means: columnname doesn’t contain ‘ABC’According to the docs:
So if you ask for:
then if either ‘ABC’ or ‘XYZ’ has a score of
0it will have the lowest score and that’s what you’ll get from the function, so you’re actually asking for: columnname doesn’t contain ‘ABC’ or ‘XYZ’ (at least one of them).Same thing for the
or–only if both ‘ABC’ and ‘XYZ’ have the score of
0the function will return0, so you’re actually asking for: columnname doesn’t contain ‘ABC’ and ‘XYZ’ (both of them).IMHO, this behaviour is correct since it meets De-Moragan’s Laws