This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / is there a sql(Oracle) statement that will ignore the precedence? eg.
"where description like '%des1%des2%des3%' " will return result containing desc1,desc2 and desc3 regardless of precedence.
-rawmoon(rawmoon);
2005-12-2
(#2640295@0)
-
you probably need to use "or"the "like" operator only support % and _, the function is very limited, don't expect it can handle complex regular expression.
Another point, when you use " col1 like '%pattern%' " you better add some extra condition check(use index column whenever is possible) otherwise, the query will do table scan and take huge amount of I/O especially for big tables. Generally, using " like '%pattern%' " is not good because range search (index) won't work , if possible, use "like 'pattern%....." .
-ubs(ubs);
2005-12-2
{507}
(#2640366@0)
-
working on a web search engine. it doesn't make sense to ask a user to enter words in a certain sequence, also it seems so lousy to do a n! times of combination. performance will be considered for sure. thanks
-rawmoon(rawmoon);
2005-12-2
(#2640393@0)
-
I just google oracle, they are support REGEXP_LIKE in oracle10g, looks like that's what's you want,http://www.oracle.com/technology/oramag/webcolumns/2003/techarticles/rischert_regexp_pt1.html
-ubs(ubs);
2005-12-2
{93}
(#2640413@0)
-
thanks. I will check it out.
-rawmoon(rawmoon);
2005-12-2
(#2640526@0)
-
do u mean - where description like "xxx1" AND description like "xxx2" AND description like "xxxx3"
-elecskunk(elecskunk);
2005-12-2
(#2640411@0)
-
no. it is more like: select name from mytable where description like '%desc1%desc2%' OR description like '%desc2%desc1%'. but think about if I have desc1,2, ...10.
-rawmoon(rawmoon);
2005-12-2
(#2640531@0)