Name

BIT_AND()

Synopsis

BIT_AND(expression)

This function returns the bitwise AND for all bits for the expression given. Use this in conjunction with the GROUP BY clause. The function has a 64-bit precision. If there are no matching rows, before version 4.0.17 of MySQL, –1 is returned. Newer versions return 18446744073709551615, which is the value of 1 for all bits of an unsigned BIGINT column.

Get MySQL in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.