Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,
My column consists of a special character % in some of records.... Now i want an SQl query to list out the records which cotains % symbol

NOTE: I need a query which will be searched with like operator
Posted

Try:
SQL
SELECT * FROM MyTable WHERE dataCol LIKE '%[%]%'
 
Share this answer
 
Below Query will give you all students having % character in their name

select * from Student WHERE CHARINDEX('%',[Student Name],0)>1


Hope this helps
 
Share this answer
 
try this
SQL
select x from users
where columnToBeSearched like '%[%]%' OR
  otherColumnToBeSearched like '%[%]%'


or use this

SQL
SELECT * FROM TABLE WHERE COLUMN_NAME LIKE '%[^a-zA-Z0-9]%'
 
Share this answer
 
v2
hi

please try this.may It helps you

suppose column contains value as
1234%
11
121
1
and so on...........

and you need to find the value which contain % in that value.
plz try this query


SELECT * FROM tablename WHERE fieldname LIKE ‘%1234[%]%’


plz mark as complete if t helps you
 
Share this answer
 
hi

please try this

suppose column contains value as
1234%
11
121
1
and so on...........

and you need to find the value which contain % in that value.
plz try this query


SELECT * FROM tablename WHERE fieldname LIKE ‘%1234[%]%’


plz mark as complete if t helps you
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900