how to select rows for a sum function

Поиск
Список
Период
Сортировка
От e-letter
Тема how to select rows for a sum function
Дата
Msg-id BANLkTinqrF5C9hB6cbkPhmK6kb7tq+dHcw@mail.gmail.com
обсуждение исходный текст
Ответы Re: how to select rows for a sum function  (Frank Bax <fbax@sympatico.ca>)
Список pgsql-novice
Readers,

For a table:

value name
10 text1
20 text2
30 text3
40 text4

The function SELECT ... WHERE cannot be used with an aggregate
function SUM. Is it possible to obtain a result of the rows where the
SUM<=number? Ideally, to obtain rows where the sum of values is
between an upper and lower value, e.g. if the target range is >=50 and
<=60, the result would be:

text1
text2
text3

or

text2
text4

Each result should go into a separate table

В списке pgsql-novice по дате отправления:

Предыдущее
От: Mike Thomsen
Дата:
Сообщение: Log user creation and deletion
Следующее
От: "Birchall, Austen"
Дата:
Сообщение: pg_stop_backup fails to complete