On 17 Oct 2016, at 3:03pm, Igor Tandetnik <i...@tandetnik.org> wrote:

> select unit, sum(1 << bit_position) from table1 where val group by unit;

Beat me to it. I was going to say

select unit, sum(val << bit_position) as byte from table1 group by unit;

But yours is slightly more efficient not summing the zeros (if there were any)

Andy
---------------------------------------------------------------------------------------
This email has been scanned for email related threats and delivered safely by 
Mimecast.
For more information please visit http://www.mimecast.com
---------------------------------------------------------------------------------------

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to