问题描述:

This question already has an answer here:

  • How do I escape a percentage sign in T-SQL?

    3 answers

网友答案:

try this query

select * from tablename where columnname like '%[%]%'
网友答案:

You can use WHERE Id LIKE '%[%]%'. An example will be something like this:

CREATE TABLE #Test
(
Id NVARCHAR(100)
)

INSERT INTO #Test VALUES ('100%'), ('1000')

SELECT * FROM #Test
WHERE Id LIKE '%[%]%'

DROP TABLE #Test

OUTPUT:

Id
100%
网友答案:

We use like clause/operator to find/match anything in columns. Below query will search '%' in starting/middle/ending or can say everywhere in a column value.

select * from tablename where columnname like '%[%]%'.
网友答案:

Try following,

select * from tablename where columnname like '%\%%'
相关阅读:
Top