Skip Headers

Oracle® Database SQL Reference
10g Release 1 (10.1)

Part Number B10759-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

BIN_TO_NUM


Syntax

bin_to_num::=
Description of bin_to_num.gif follows
Description of the illustration bin_to_num.gif


Purpose

BIN_TO_NUM converts a bit vector to its equivalent number. Each argument to this function represents a bit in the bit vector. This function takes as arguments any numeric datatype, or any nonnumeric datatype that can be implicitly converted to NUMBER. Each expr must evaluate to 0 or 1. This function returns Oracle NUMBER.

BIN_TO_NUM is useful in data warehousing applications for selecting groups of interest from a materialized view using grouping sets.


See Also:



Examples

The following example converts a binary value to a number:

SELECT BIN_TO_NUM(1,0,1,0) FROM DUAL; 

BIN_TO_NUM(1,0,1,0)
-------------------
                 10