| От | Scara Maccai |
|---|---|
| Тема | Array operator "sum array values" |
| Дата | |
| Msg-id | 433303.6094.qm@web28106.mail.ukl.yahoo.com обсуждение исходный текст |
| Ответы |
Re: Array operator "sum array values"
|
| Список | pgsql-general |
Hi,
is there a syntax that sums the values of an array?
That is, having an array like
{1,3,8},{5,6,7}
something like
select arr[1:2][2:3]
gives
{1,3},{6,7}
; what I'd like is:
select arr[1$2][2$3]
gives:
17 (that is, 1+3 + 6+7)
If there is no such operator, would it be complicated adding it to postgres?
I mean: is the "[:]" operator an internal thing (the parser "knows" about it) or is it just like any other operators
thatcan be added ?
___________________________________
Scopri il Blog di Yahoo! Mail: trucchi, novità, consigli... e la tua opinione!
http://www.ymailblogit.com/blog/
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера