short-cutting if sum()>constant

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: pgsql-sql(at)postgresql(dot)org
Subject: short-cutting if sum()>constant
Date: 2009-12-22 12:35:27
Message-ID: 20091222133527.3007bd96@dawn.webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I'd like to know if

select sum(qty) from t where status=37;

is > constant.

qty is always >0.

Is there a way to skip examining further rows and return a result
ASAP?

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Filip Rembiałkowski 2009-12-22 13:48:55 Re: short-cutting if sum()>constant
Previous Message Scott Marlowe 2009-12-22 09:22:36 Re: 8.4.1 distinct query WITHOUT order by