All Forums Analytics
Bohica 10 posts Joined 07/08
24 Sep 2008
How to search for all % in a column

SELECT v_high, v_low, INDEX(first_hit_referrer,'%') AS location, SUBSTRING(first_hit_referrer FROM INDEX(first_hit_referrer,'%') FOR 3) AS val, first_hit_referrerFROM tbl1WHERE FIRST_HIT_REFERRER LIKE '%"%"%'The above does not give me the results I need.

Fred 1096 posts Joined 08/04
25 Sep 2008

Not clear exactly what you intend, but perhaps this will help. Since '%' and '_' have special meaning in a LIKE clause, if you want to match those characters you must define and use an ESCAPE character, e.g. ... LIKE '%\%%' ESCAPE '\'Matches if the field contains at least one % character somewhere

You must sign in to leave a comment.