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.
Comments
Post a Comment