PLSQL | BITAND Function Last Updated : 12 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The BITAND is an inbuilt function in PLSQL which is used to returns an integer value which is calculated with AND operation of two given input decimal number. Internally these input decimal numbers get converted into binary numbers and then AND operation is performed and results are returned as output. Syntax: BITAND(num1, num2) Parameters Used: This function is accepting two parameters which are num1 and num2. These two parameters are input decimal number which get converted into binary number internally and on which BITAND function is called. Return Value: This function returns an integer value which is calculated with BIT wise AND operation of two given input decimal number. Supported Versions of Oracle/PLSQL is given below: Oracle 12c Oracle 11g Oracle 10g Oracle 9i Oracle 8i Let's see some examples which will illustrate the BITAND function: Example-1: DECLARE Test_Number number1 := 5; Test_Number number2 := 3; BEGIN dbms_output.put_line(BITAND(Test_Number number1, Test_Number number2)); END; Output: 1 Here two numbers 5 and 3 are taken as the parameter. These two decimal numbers get converted into the binary equivalent. Binary equivalent of 5 and 3 are 101 and 011 respectively. Later this two binary number goes under AND operation and gives a new binary number 001 whose decimal equivalent is 1 and hence 1 is returned as output. Example-2: DECLARE Test_Number number1 := 5; Test_Number number2 := 0; BEGIN dbms_output.put_line(BITAND(Test_Number number1, Test_Number number2)); END; Output: 0 Here two numbers 5 and 0 are taken as the parameter. These two decimal numbers get converted into the binary equivalent. Binary equivalent of 5 and 0 are 101 and 000 respectively. Later this two binary number goes under AND operation and gives a new binary number 000 whose decimal equivalent is 0 and hence 0 is returned as output. Advantage: This function is used to calculate BIT wise AND operation for the two given input decimal numbers. Comment More infoAdvertise with us Next Article SQL | Advanced Functions K Kanchan_Ray Follow Improve Article Tags : SQL SQL-PL/SQL Similar Reads MySQL BIN() Function The BIN() function in MySQL converts a decimal number to its binary equivalent. The BIN() function is equivalent to the CONV() function written in the format CONV(number,10,2). In this format, the CONV() function converts the number 'number' from base 10 (decimal) to base 2 (binary). It is important 1 min read MySQL | BINARY Function The MySQL BINARY function is used for converting a value to a binary string. The BINARY function can also be implemented using CAST function as CAST(value AS BINARY). The BINARY function accepts one parameter which is the value to be converted and returns a binary string. Syntax: BINARY value Parame 1 min read SQL | Advanced Functions SQL (Structured Query Language) offers a wide range of advanced functions that allow you to perform complex calculations, transformations, and aggregations on your data. Aggregate Functions In database management an aggregate function is a function where the values of multiple rows are grouped toget 2 min read PLSQL | LOG Function The PLSQL LOG function is used for returning the logarithm of n base m. The LOG function accepts two parameters which are used to calculate the logarithmic value. The LOG function returns a value of the numeric data type. This function takes as an argument any numeric data type as well as any non-nu 2 min read PLSQL | MOD Function The MOD function is an inbuilt function in PLSQL which is used to return the remainder when a is divided by b. Its formula is m - n * \left\lfloor\dfrac{m}{n}\right\rfloor. Syntax: MOD(a, b) Parameters Used: This function accepts two parameters a and b. This function gives remainder as the output wh 2 min read BIT_OR() Function in MySQL BIT_OR() function in MySQL is used to return the bitwise OR of all bits in a given expression. It first converts all decimal values into binary values, and then perform bitwise or operation on those binary values. Syntax : BIT_OR(expr) Parameter : This method accepts only one parameter. expr - Input 4 min read Like