Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 8B5E963465A for ; Tue, 22 Dec 2009 15:22:14 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 61020-01-7 for ; Tue, 22 Dec 2009 19:22:06 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from forward12.mail.yandex.net (forward12.mail.yandex.net [95.108.130.94]) by mail.postgresql.org (Postfix) with ESMTP id 29A94634F2A for ; Tue, 22 Dec 2009 15:15:06 -0400 (AST) Received: from webmail116.yandex.ru (webmail116.yandex.ru [95.108.130.13]) by forward12.mail.yandex.net (Yandex) with ESMTP id 1076A15D01E1 for ; Tue, 22 Dec 2009 22:15:03 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by webmail116.yandex.ru (Yandex) with ESMTP id E7E4F36BC3CE for ; Tue, 22 Dec 2009 22:15:02 +0300 (MSK) X-Yandex-Spam: 1 X-Yandex-Front: webmail116 X-Yandex-TimeMark: 1261509302 Received: from user-28.81.118.217.in-addr.arpa (user-28.81.118.217.in-addr.arpa [217.118.81.28]) by mail.yandex.ru with HTTP; Tue, 22 Dec 2009 22:15:02 +0300 From: msi77 To: pgsql-sql@postgresql.org In-Reply-To: <20091222173009.GA15386@tux> References: <20091222133527.3007bd96@dawn.webthatworks.it> <20091222141231.GE10308@a-kretschmer.de> <6521261494681@webmail110.yandex.ru> <20091222173009.GA15386@tux> Subject: Re: short-cutting if sum()>constant MIME-Version: 1.0 Message-Id: <1751261509302@webmail116.yandex.ru> Date: Tue, 22 Dec 2009 22:15:02 +0300 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.58 tagged_above=-10 required=5 tests=BAYES_50=0.001, RCVD_IN_BL_SPAMCOP_NET=1.96, RCVD_IN_SORBS_WEB=0.619 X-Spam-Level: ** X-Archive-Number: 200912/63 X-Sequence-Number: 33501 > Sorry, but i don't know how a CTE can help in this case, can you explain I mean RECURSIVE CTE. You can check your condition on each iteration and stop execution when condition is false. Sergey > msi77 wrote: > > Развернуть > > Does PG support CTE? > Since 8.4 yes. > > Развернуть > > You can try it. > Sorry, but i don't know how a CTE can help in this case, can you explain > that? > Andreas > Здесь спама нет http://mail.yandex.ru/nospam/sign