Re: Check for an empty result

From: Eus <eus(at)member(dot)fsf(dot)org>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: Postgresql General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Check for an empty result
Date: 2009-02-16 02:08:23
Message-ID: 29648.9994.qm@web37603.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Craig!

--- On Fri, 2/13/09, Craig Ringer <craig(at)postnewspapers(dot)com(dot)au> wrote:

> Eus wrote:
> > Hi Ho!
> >
> > Is there a way to check whether or not a subquery
> returns an empty result set?
>
> "EXISTS"
>
> SELECT blah FROM blah WHERE EXISTS (SELECT 1 FROM tablename
> WHERE ...);

Thank you. Previously I tried: "... WHERE (...) IS NULL;". Of course, it didn't work.

> > postgre check "empty result set"
>
> It's not "postgre". It's PostgreSQL, or
> "postgres". This matters when
> you're searching.

Oh, okay. Thanks for telling me.

> --
> Craig Ringer

Best regards,
Eus (FSF member #4445)

In this digital era, where computing technology is pervasive, your freedom depends on the software controlling those computing devices.

Join free software movement today! It is free as in freedom, not as in free beer!

Join: http://www.fsf.org/jf?referrer=4445

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Eus 2009-02-16 02:15:57 Re: Check for an empty result
Previous Message Scott Marlowe 2009-02-15 23:58:11 Re: Running untrusted sql safely?