pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dan Langille <dan@langille.org>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Removing simliar elements from a set
Date: Sat, 27 Sep 2003 08:38:27 -0400
Message-ID: <3F754C83.22347.29465C5B@localhost> (raw)
In-Reply-To: <200309261655.13695.josh@agliodbs.com>
References: <20030926184440.B301@laptop.unixathome.org>

On 26 Sep 2003 at 16:55, Josh Berkus wrote:

> Dan, 
> 
> > I'm trying to remove items from a set which are similar to items in
> > another set.
> <snip>
> 
> > In short, we remove all items from MASTER which are under the directories
> > specified in MATCHES.
> 
> from your example, you are trying to remove all directories which do *not* 
> match.   What do you want, exactly?

Josh and I talked on IRC about this.

This is the result set I want:

 /ports/Mk/bsd.python.mk

I want things from MASTER which do not match things in MATCHES.

Josh suggested this:

SELECT * 
  FROM master 
 WHERE NOT EXISTS (
   SELECT *
     FROM matches 
     WHERE master.pathname LIKE (matches.pathname || '/%'));

Cheers.
-- 
Dan Langille : http://www.langille.org/




view thread (3+ messages)

Message-ID: <3F754C83.22347.29465C5B@localhost>
Permalink:  ../3F754C83.22347.29465C5B@localhost/
Also on:    postgresql.org/message-id/3F754C83.22347.29465C5B@localhost

 · 

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-sql@postgresql.org
  Cc: dan@langille.org, josh@agliodbs.com
  Subject: Re: Removing simliar elements from a set
  In-Reply-To: <3F754C83.22347.29465C5B@localhost>

* 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