Tim Robinson wrote:
> select * from temp where a like 'a\\\'%'
>
> this should return all strings starting with a\' but it returns
> nothing!!!
\ is also the quoting character of LIKE, in addition to being a quoting
character on the string literal level. If you want all strings
starting with a\' then use something like:
a LIKE 'a\\\'%' ESCAPE '!'
where '!' selects some other escape character for LIKE that doesn't get
in the way. The documentation on LIKE contains the details on this
mechanism.