Hamming weight/population count in T-SQL
-
29-10-2019 - |
Pergunta
I'm looking for a fast way to calculate the hamming weight/population count/"the number of 1 bits" of a BINARY(1024) field. MySQL has a BIT_COUNT function that does something like that. I couldn't find a similar function in T-SQL?
Or would you suggest storing the binary data in a field of another type?
If you don't know what I'm talking about, here's a Wikipedia article about the hamming weight.
Nenhuma solução correta
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow