Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 905
Relativity Avatar asked Dec 13 '22 12:12

Relativity


2 Answers

Like this

where Remarks like'%[%]%'

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

like image 154
SQLMenace Avatar answered Jan 28 '23 14:01

SQLMenace


SELECT *
    FROM YourTable
    WHERE CHARINDEX('%', Remarks) > 0
like image 37
Joe Stefanelli Avatar answered Jan 28 '23 14:01

Joe Stefanelli