pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Phuong Ma <pma@commandprompt.com>
To: pgsql-general@postgresql.org
To: pgsql-sql@postgresql.org
Subject: inconsistent functionality with LIKE operator
Date: Thu, 29 Mar 2001 08:25:30 +0000
Message-ID: <3AC2F17A.BFC50830@commandprompt.com> (raw)

I'm using PostgreSQL version 7.1, and I'm having trouble with the LIKE
statement.  How would I find the value "a\bc"?  I tried using the
backslash to escape it: LIKE 'a\\b%';

If I specify: LIKE 'a\\bc', then it works, but if I wanted it to look
for consecetive characters after the c, using the %, then it returns
other values besides what I'm looking for.

I also have the same problem with percent (%).  I have a test string
with the value "ab%c", and I want to look for that using LIKE.  I tried:
LIKE 'ab\%c', LIKE 'ab%%', and LIKE 'ab\%_', but these statements not
only returned what I was looking for, but also other values:
"abc","ABC", and "Abc". 

Phuong



view thread (3+ messages)  latest in thread

Message-ID: <3AC2F17A.BFC50830@commandprompt.com>
Permalink:  ../3AC2F17A.BFC50830@commandprompt.com/
Also on:    postgresql.org/message-id/3AC2F17A.BFC50830@commandprompt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: pma@commandprompt.com, pgsql-general@postgresql.org
  Subject: Re: inconsistent functionality with LIKE operator
  In-Reply-To: <3AC2F17A.BFC50830@commandprompt.com>
  References: <3AC2F17A.BFC50830@commandprompt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox