Escaping a question mark on the MySQL CLI

How do you escape a question mark character in a string on the MySQL CLI?

There are many methods to avoid having to escape characters, but from an ease-of-use perspective I would quite like to do some SELECT statements containing LIKE queries, some of which contain question marks and the usual \? does not work.

Answer

LIKE doesn’t use ?. LIKE uses % and _.

Attribution
Source : Link , Question Author : Metalshark , Answer Author : Ignacio Vazquez-Abrams

Leave a Comment