apply limit to sum function

From: e-letter <inpost(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: apply limit to sum function
Date: 2012-04-27 19:27:09
Message-ID: CAET1fe7eu-Es13-Zn1oEV+nZVaQGZFa=v9w8t2JT-TditcfWRg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Readers,

Is it possible to apply the 'sum' function, but limit the value and
then show the tuples of the result? For example, the table has:

text1, 10
text2, 12,
text3, 23

Instead of applying the 'sum' function to all values, the request is
to be able to select those values that result in a sum of a target
value (e.g. < 22) and then return the tuples.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Steve Crawford 2012-04-27 19:59:31 Re: apply limit to sum function
Previous Message Bartosz Dmytrak 2012-04-25 21:01:32 Re: Returning generated id after a transaction.