开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜