pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kenneth Marshall <ktm@rice.edu>
To: sivapostgres@yahoo.com <sivapostgres@yahoo.com>
Cc: Postgresql General Group <pgsql-general@lists.postgresql.org>
Subject: Re: select * from test where name like 'co_%'
Date: Tue, 10 Mar 2020 07:54:28 -0500
Message-ID: <20200310125428.GV32117@aart.rice.edu> (raw)
In-Reply-To: <1482349013.1084585.1583844541651@mail.yahoo.com>
References: <1482349013.1084585.1583844541651.ref@mail.yahoo.com>
	<1482349013.1084585.1583844541651@mail.yahoo.com>

On Tue, Mar 10, 2020 at 12:49:01PM +0000, sivapostgres@yahoo.com wrote:
> Hello,
> What returns when I run a query like this;
> Select * from test where name like 'co_%';
> I expect anything that starts with 'co_' and NOT 'co' only.  Am I right?  But I get every names that starts with 'co'. Why ?
> Happiness Always
> BKR Sivaprakash

Hi,

Check out the documentation:

https://www.postgresql.org/docs/12/functions-matching.html#FUNCTIONS-LIKE

You have 2 meta characters there. The '_' matches any character also.

Regards,
Ken





view thread (4+ messages)  latest in thread

Message-ID: <20200310125428.GV32117@aart.rice.edu>
Permalink:  ../20200310125428.GV32117@aart.rice.edu/
Also on:    postgresql.org/message-id/20200310125428.GV32117@aart.rice.edu

 · 

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-general@postgresql.org
  Cc: ktm@rice.edu, sivapostgres@yahoo.com
  Subject: Re: select * from test where name like 'co_%'
  In-Reply-To: <20200310125428.GV32117@aart.rice.edu>
  References: <1482349013.1084585.1583844541651.ref@mail.yahoo.com> <1482349013.1084585.1583844541651@mail.yahoo.com> <20200310125428.GV32117@aart.rice.edu>

* 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