Re: OR-ing rows of bits

Поиск
Список
Период
Сортировка
От Antonio Fiol Bonnín
Тема Re: OR-ing rows of bits
Дата
Msg-id 3C14F928.9010304@w3ping.com
обсуждение исходный текст
Ответ на OR-ing rows of bits  ("Thomas T. Thai" <tom@minnesota.com>)
Список pgsql-general
Thomas T. Thai wrote:

>what's the best way of OR-ing rows of bits or integers? SUM works for bits
>that are all atomic (1, 2, 4, 8, ...) but not for inclusive (1, 3, 7,
>...).
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>.
>
I'd bet for a custom aggregate function.

Something like the ready-to-go statement

CREATE AGGREGATE int4or_aggregate ( BASETYPE=int4, SFUNC=int4or,
STYPE=int4 );

Hope that helps.

Antonio Fiol


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

Предыдущее
От: "Raul DAVIDOVICH"
Дата:
Сообщение: problem with select after updating
Следующее
От: Frank Joerdens
Дата:
Сообщение: Re: use BLOBS or use pointers to files on the filesystem?