I am looking for a way to "mask" bits using an AND in a select statement, or equivalent.
I need to replicate a select statement we have on SQLServer, that strips of the top bits of a number and returns the max value without them e.g. :-
select max(cast(entity_id as bigint) & 0x0ffff) from entity;
Only keeping the bottom X bits of the value in the column, where the entity_id column is a "number(16,0)". I just cant find the way to do it in Oracle tho...
Thanks,
JOC
I need to replicate a select statement we have on SQLServer, that strips of the top bits of a number and returns the max value without them e.g. :-
select max(cast(entity_id as bigint) & 0x0ffff) from entity;
Only keeping the bottom X bits of the value in the column, where the entity_id column is a "number(16,0)". I just cant find the way to do it in Oracle tho...
Thanks,
JOC