Efficiently determining the number of bits set in the contents of a VARBIT field

Поиск
Список
Период
Сортировка
От Allan Kamau
Тема Efficiently determining the number of bits set in the contents of a VARBIT field
Дата
Msg-id 488B2404.7080106@sanbi.ac.za
обсуждение исходный текст
Список pgsql-sql
Hi all,
Am looking for a fast and efficient way to count the number of bits set 
(to 1) in a VARBIT field. I am currently using 
"LENGTH(REGEXP_REPLACE(CAST(a.somefield_bit_code AS TEXT),'0','','g'))".

Allan.



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

Предыдущее
От: Volkan YAZICI
Дата:
Сообщение: Re: Test if a table is present
Следующее
От: Giorgio Valoti
Дата:
Сообщение: Re: Select default values