How can I escape square brackets in a LIKE clause?

后端 未结 10 2049
被撕碎了的回忆
被撕碎了的回忆 2020-11-22 14:28

I am trying to filter items with a stored procedure using like. The column is a varchar(15). The items I am trying to filter have square brackets in the name.

For ex

10条回答
  •  自闭症患者
    2020-11-22 14:39

    Instead of '\' or another character on the keyboard, you can also use special characters that aren't on the keyboard. Depending o your use case this might be necessary, if you don't want user input to accidentally be used as an escape character.

提交回复
热议问题