Re: Search for underscore w/ LIKE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: brianb-pgsql(at)edsamail(dot)com, pgsql-sql(at)postgresql(dot)org, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: Search for underscore w/ LIKE
Date: 2000-07-07 18:21:38
Message-ID: 11200.962994098@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I wrote:
> Similarly, '\\%' would be the way to match a literal %. You can
> actually backslash-quote any single character this way in LIKE,
> but % and _ are the only ones where it makes a difference.

Er, check that. Backslash itself also needs quoting in LIKE.

Exercise for the student: if you need to match a literal backslash
in a LIKE pattern, how many backslashes do you have to write in your
query?

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Web Manager 2000-07-07 18:23:22 Re: order by accents?
Previous Message Tom Lane 2000-07-07 18:12:34 Re: Re: [HACKERS] Re: [SQL] MAX() of 0 records.