Finding similar values in columns For example I have a column id and column email. I would like to find all values from id and column that share similar pattern.

let's say:
in id 'column' I have Alexander and in 'email' column - walex@sample.com.
if I set similarity to 4 - means match 4 character in row

script should find alexander and walex@sample.com cause they have 4 charachters match (alex)

What's the best way to accomplish something like this?
If you have a numbers table populated with integers up to the max length the strings in the data can be

SELECT Y.*
FROM   YourTable Y,
(SELECT 4 AS NumChar) T /* Change this line to alter desired length*/
WHERE  EXISTS (SELECT *
               FROM   Numbers N
               WHERE  N.N &lt; LEAST(LENGTH(name), LENGTH(email)) - FLOOR(NumChar/2)
                      AND GREATEST(LOCATE(SUBSTRING(Name, N, NumChar), email), 
                                   LOCATE(SUBSTRING(email, N, NumChar), Name)) &gt; 0)


SQL Fiddle