So everyone knows sql LIKE to search wildcard matches the criteria. How about in a situation that you need to return all the rows that has value is part of the criteria string.
eg. given a full URL http://www.abc.com/bl/abcdefg/, return all the rows with uri_part field that values are part of the URL string.
+------------+ |uri_part | +------------+ |/bl/ | |/bl/abc/ | |/ba/abc/ | +------------+
Normally LIKE statement works on the other way around, so you need to use LOCATE function. So in this example would be:
SELECT uri_part FROM table WHERE locate(uri_part, 'http://www.abc.com/bl/abcdefg/');