Re: How to match percent sybmol in LIKE operator?

From: Holger Klawitter <holger(at)klawitter(dot)de>
To: Sergey Filatov <fs(at)ibis(dot)odessa(dot)ua>, "pgsql-general(at)postgreSQL(dot)org" <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: How to match percent sybmol in LIKE operator?
Date: 2001-01-15 13:55:42
Message-ID: 3A63015E.4C6CBFC2@klawitter.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sergey Filatov wrote:
>
> Greetings.
>
> My problem is to find percent character in some field.
> I'm wonder how specify percent character or other wildcard characters
> in 'LIKE patterns'?
>
> Many thanks in advance,
> Sergey.

You have escape them with the backslash. In order to pass the backslash
to the backend you have to escape the backslash as well:

select * from xxx where yyy like '\\%';

It might be a good idea to point this out in the Postgresql book :-)

With kind regards,
Holger Klawitter
--
Holger Klawitter
holger(at)klawitter(dot)de http://www.klawitter.de

In response to

Browse pgsql-general by date

  From Date Subject
Next Message rob 2001-01-15 14:12:19 Re: converting .xls to delimited file
Previous Message Sergey Filatov 2001-01-15 13:39:21 How to match percent sybmol in LIKE operator?