Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: BITAND function

Re: BITAND function

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Wed, 25 Aug 1999 10:04:57 +0200
Message-ID: <7q084j$fta$1@oceanite.cybercable.fr>


Bitand function converts the two parameters into bit strings of the same length and applies AND operation between each bit and then converts to a number.

bit1 AND bit1 returns 1 if the two bits are 1 and 0 else.

For example:
create table t (col number);

insert into t values (0);
insert into t values (1);
insert into t values (2);
insert into t values (3);

/* Keep the last bit, or is col odd */
select bitand(col,1) from t order by col; -
0
1
0
1
/* Keep the last but one bit */
select bitand(col,2) from t order by col; B
-
0
0
2
2
/* Keep the two last bits */
select bitand(col,3) from t order by col; B
-
0
1
2
3
/* And so on */
select bitand(col,4) from t order by col; B
-
0
0
0
0
...

Vsevolod Afanassiev a écrit dans le message <7pvbar$7p13_at_xlprod01.westpac.com.au>...
>Could someone tell me what BITAND function is?
>It is not documented ...
>Seems to be
>
> integer=bitand(integer,integer)
>
>It is used, e.g. to find enqueue name from V$SESSION_WAIT
>
>Thanks...
>Vsevolod
>
>
>
>
>
Received on Wed Aug 25 1999 - 03:04:57 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US