Re: Check for an empty result

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: eus(at)member(dot)fsf(dot)org
Cc: Postgresql General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Check for an empty result
Date: 2009-02-13 09:17:08
Message-ID: 49953A94.2060705@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 ...);

> postgre check "empty result set"

It's not "postgre". It's PostgreSQL, or "postgres". This matters when
you're searching.

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2009-02-13 09:17:26 Re: Check for an empty result
Previous Message Eus 2009-02-13 08:57:48 Check for an empty result