Suppose we have a table with the below values
DECLARE @T TABLE(Email VARCHAR(50))
INSERT INTO @T SELECT 'testing@yopmail.com' UNION ALL SELECT 'testing@gmail.com'
We want to list out only the
yopmail's . The below TSQL Code will do so
SELECT *
FROM @T
WHERE PATINDEX('%yopmail%',Email) > 0
/*
Email
-----------
testing@yopmail.com
*/