How to find Special character in a string using SQL LIKE operator

How to find a special character in a string




Query – I
This query finds all special character in a string.
SELECT Employeeid,FirstName FROMEmployees
WHERE FirstName  like  ‘%[^0-9A-Z]%’
 

Query – II
This query finds only a specified special character in a string.

SELECT Employeeid,FirstName FROMEmployees
WHERE FirstName  like  ‘%[@,#,$,%,*]%’

Query – III
This query finds numeric value in a string.
SELECT Employeeid,FirstName FROM Employees
WHERE FirstName  like  ‘%[0-9]%’
 

Leave a Reply

Your email address will not be published. Required fields are marked *