pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve Holdoway <steve.holdoway@firetrust.com>
To: pgsql-admin@postgresql.org
Subject: Re: except command
Date: Tue, 14 Aug 2007 06:13:58 +1200
Message-ID: <20070814061358.d66d2cb3.steve.holdoway@firetrust.com> (raw)
In-Reply-To: <46C0579F.EE98.0025.0@wicourts.gov>
References: <46C099F6.8050002@cerene.fr>
	<46C0579F.EE98.0025.0@wicourts.gov>

On Mon, 13 Aug 2007 13:07:43 -0500
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> wrote:

> >>> On Mon, Aug 13, 2007 at 12:50 PM, in message <46C099F6.8050002@cerene.fr>,
> olivier boissard <olivier.boissard@cerene.fr> wrote: 
> > I tried to use the except command in postgresql 8.1
> > I don't understand as it works
> > When I read doc , I understand that it was like a difference betwwen two 
> > queries
> 
> That isn't how I read it:
>  
> "The EXCEPT operator returns the rows that are in the first result set
> but not in the second."
>  
> ( http://www.postgresql.org/docs/8.1/interactive/sql-select.html )
>  
> Are you seeing something different?
>  
> This gets me all the eye color codes that don't start with the letter 'B'.
> (There are of course easier ways to get that...)
>  
> bigbird=> select * from "EyeColorCode" except select * from "EyeColorCode" where "eyeColorCode" like 'B%';
>  eyeColorCode |      descr      | isActive | dotEyeColorCode
> --------------+-----------------+----------+-----------------
>  GRN          | Green           | t        | GRN
>  GRY          | Gray            | t        | GRY
>  HAZ          | Hazel           | t        | HAZ
>  MAR          | Maroon          | t        | MAR
>  MUL          | Multicolored    | t        | DIC
>  PNK          | Pink            | t        | PNK
>  XXX          | Unknown         | t        | UNK
> (7 rows)
>  
> -Kevin
so is this faster than usiung 'where not exists' ??

Steve



view thread (7+ messages)  latest in thread

Message-ID: <20070814061358.d66d2cb3.steve.holdoway@firetrust.com>
Permalink:  ../20070814061358.d66d2cb3.steve.holdoway@firetrust.com/
Also on:    postgresql.org/message-id/20070814061358.d66d2cb3.steve.holdoway@firetrust.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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: steve.holdoway@firetrust.com
  Subject: Re: except command
  In-Reply-To: <20070814061358.d66d2cb3.steve.holdoway@firetrust.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