aggregate functions, COUNT

From: Kevin Way <kevin(dot)way(at)overtone(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: aggregate functions, COUNT
Date: 2001-10-02 16:11:21
Message-ID: 20011002161121.A8772@bean.overtone.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I'm currently using a SELECT count(*) when all I really want to know is
if 1 or more records exist. Is there a standard way to just find out if
a record exists? If not, is there a way to avoid iterating over all the
records by writing an aggregate function? Given what I've read of how
they work, I don't see how to make the function return before parsing
all the results anyway, am I wrong here?

Thanks for any help, or 2x4s,
Kevin Way

--
Kevin Way <kevin(dot)way(at)overtone(dot)org>
http://www.overtone.org/

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2001-10-02 16:32:33 Re: Question about indexing!
Previous Message Tom Lane 2001-10-02 15:49:49 Re: strange query execution times