How to search for “%” in sql table-column

折月煮酒 提交于 2019-12-23 15:34:03

问题


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


回答1:


Like this

where Remarks like'%[%]%'

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




回答2:


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



回答3:


there are 2 ways, you could use

where Remarks like '%[%]%'

or

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


来源:https://stackoverflow.com/questions/6231744/how-to-search-for-in-sql-table-column

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!