Relativity
Relativity

Reputation: 6868

How to search for "%" in sql table-column

I have a table with a column "Remarks"...How to search "%" in this column?

Upvotes: 4

Views: 209

Answers (3)

Patrick McDonald
Patrick McDonald

Reputation: 65461

there are 2 ways, you could use

where Remarks like '%[%]%'

or

where Remarks like '%!%%' escape '!'

Upvotes: 1

Joe Stefanelli
Joe Stefanelli

Reputation: 135888

SELECT *
    FROM YourTable
    WHERE CHARINDEX('%', Remarks) > 0

Upvotes: 6

SQLMenace
SQLMenace

Reputation: 135161

Like this

where Remarks like'%[%]%'

you need to put brackets around it, more info here LIKE (Transact-SQL)

Upvotes: 6

Related Questions