How to count ones in a bit string?

Поиск
Список
Период
Сортировка
От Cheng
Тема How to count ones in a bit string?
Дата
Msg-id 4F43B923.1010402@gmail.com
обсуждение исходный текст
Ответы Re: How to count ones in a bit string?  (Richard Broersma <richard.broersma@gmail.com>)
Список pgsql-novice
For example, I have a bit string as:

B'101000000000000000000010'

How do I count the number of ones in it? In this example, it is 3.

Thanks,
Cheng

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

Предыдущее
От: Ganesh Borse
Дата:
Сообщение: Request for help on selecting bytea columns using ODBC (windows) from Postgresql DB
Следующее
От: Richard Broersma
Дата:
Сообщение: Re: How to count ones in a bit string?