December 13, 2013 at 9:43 am
I have a list of special characters .
I want to check if one particular column has any of those,they are like 20 characters I want to check.
Is there a better way to do it othan than checking with like individually?
Select *
from testname
where firstname like '@'
or like '%'
etc.
I have to check from the list
December 13, 2013 at 9:50 am
yes you can, SQL supports some regular expressions:
WITH
MyLastNames(LName) AS
(
Select 'DeCaprio@gmail' UNION ALL
Select 'Pitt[phone]' UNION ALL
Select 'Schwarzenegger(phone)' UNION ALL
Select 'Wahlberg' UNION ALL
Select 'Damon' UNION ALL
Select 'Willis'
)
SELECT
B.LName
FROM MyLastNames B
WHERE B.LName LIKE '%[!@#$%^&*()]%'
Lowell
December 16, 2013 at 8:09 am
Thanks it works
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply