| От | Tom Lane |
|---|---|
| Тема | ... |
| Дата | |
| Msg-id | 13840.938698389@sss.pgh.pa.us обсуждение |
| Ответ на | ... (David Gilbert <dgilbert@velocet.ca>) |
| Список | pgsql-hackers |
David Gilbert <dgilbert@velocet.ca> writes:
> select acct_id,
> sum(case when recd > ('now'::date - '30 days'::timespan)::date
> then amt else 0) as current
> from payable where not paid_p group by acct_id order by acct_id;
> but pgsql gives me:
> ERROR: parser: parse error at or near ")"
The case construct has to be terminated with an "end" keyword;
"... else 0 end)" ought to work.
> Now... I also thought I might be able to contruct
> sum(amt * <boolean>), but this also isn't allowed. I think that we
> should make an int(boolean) function.
That's been suggested before, and I agree.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера