BIT_OR()
BIT_OR() is a SQL function in the Aggregate Functions category. Performs a bitwise OR across all values. Returns 1 if at least one has bit set. The syntax is BIT_OR(expression). It accepts expression. It returns bitwise OR result. A typical example: SELECT BIT_OR(access_flags) FROM user_permissions WHERE dept_id = 3; -- Union of all permissions A close relative is COUNT(), which returns the number of rows (or non-NULL values) in a group. A close relative is SUM(), which returns the sum of all non-NULL values in a group. Works with numeric columns. A close relative is AVG(), which returns the average (mean) of all non-NULL values in a group. More about this category: Aggregation functions — COUNT, SUM, AVG, MIN, MAX, GROUP BY, HAVING. Related Aggregate Functions entries: COUNT(), SUM(), AVG(), MIN(), MAX(), GROUP_CONCAT() / LISTAGG(), STRING_AGG(), VARIANCE() / VAR_SAMP().