sql - Selecting multiple substrings from a field in MySQL -


i have field longtext in mysql. i'm looking instances of 'media' in it, +/- ~10 characters of context. there multiple instances in single rows' field, need see context. how can write query this? can't think of start.

so i'm looking @ this:

select field_data_body table field_data_body '%media%'; 
+----------------------------------+ | field_data_body                  | +----------------------------------+ | ... ode__media_or ... e immediat |  +----------------------------------+ 

the field long string, , parsed actual test value show substrings match clause.

what want see all instances of string media, in example above two, in other fields more. substr shows first instance of media.

in mysql can create user define function wordcount. can udf.

mysql count word in sql syntax


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -