开发者

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

开发者 https://www.devze.com 2023-03-11 10:04 出处:网络
I have a table with a column \"Remarks\"..开发者_Python百科.How to search \"%\" in this column?Like this

I have a table with a column "Remarks"..开发者_Python百科.How to search "%" in this column?


Like this

where Remarks like'%[%]%'

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


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


there are 2 ways, you could use

where Remarks like '%[%]%'

or

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

精彩评论

暂无评论...
验证码 换一张
取 消