ANDBITS()

Overview

Returns a bitwise "and" of two numbers.

USAGE

ANDBITS(number, number)

Argument Name

Description

number

Two numbers to combine with bitwise "and"

DETAILS

ANDBITS() is a bitwise function that performs a bitwise "and" of two numbers.

If you imagine each number in binary representation aligned by their least-significant bit, a bitwise "and" generates a 1 result bit for each pair of aligned bits that are 1 in both values while generating a 0 result bit for all other bit combinations.

The return value is the number representing the bits that both numbers have in common.

A NULL is returned if either argument is NULL.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT ANDBITS(5, 4), ANDBITS(1, 3), ANDBITS(0, 7);
+---------------+---------------+---------------+
| ANDBITS(5, 4) | ANDBITS(1, 3) | ANDBITS(0, 7) |
+---------------+---------------+---------------+
|             4 |             1 |             0 |
+---------------+---------------+---------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES