Re: short-cutting if sum()>constant
| От | Filip Rembiałkowski |
|---|---|
| Тема | Re: short-cutting if sum()>constant |
| Дата | |
| Msg-id | 92869e660912220548j43a4528fu28b1389477e9fb1c@mail.gmail.com обсуждение исходный текст |
| Ответ на | short-cutting if sum()>constant (Ivan Sergio Borgonovo <mail@webthatworks.it>) |
| Ответы |
Re: short-cutting if sum()>constant
|
| Список | pgsql-sql |
2009/12/22 Ivan Sergio Borgonovo <mail@webthatworks.it>
Hi,
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?
With plain SQL, no.
With a user defined function in PL/PgSQL, yes.
--
Ivan Sergio Borgonovo
http://www.webthatworks.it
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
--
Filip Rembiałkowski
JID,mailto:filip.rembialkowski@gmail.com
http://filip.rembialkowski.net/
В списке pgsql-sql по дате отправления: