开发者

Checking for bracketed varchar in SQL Server

I'm trying to pattern match a string that would look like this:

[I am a varchar contained in brackets]

This doesn开发者_StackOverflow社区't work:

LIKE '[[]%[]]'

Is my only option to use 2 and statements:

LIKE '%[]]' AND LIKE '[[]%'


I don't think you're escaping special characters correctly. Here's how you can do it:

where foo like '\[%\]' escape '\'
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜