Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query-problem: oracle to sql server

Status
Not open for further replies.

stwi1974

Programmer
Jan 29, 2002
17
DE
Hi,

im used to oracle and i need the same with sql-server:
select case bin_to_num(flag3, flag2, flag1)
when 0 then 'no flag is set'
when 1 then 'flag1 is set'
when 2 then 'flag2 is set'
when 3 then 'flag1 and flag2 is set'
when 4 then 'flag3 is set'
when 5 then 'flag1 and flag3 is set'
when 6 then 'flag2 and flag3 is set'
when 7 then 'flag1 and flag2 and flag3 is set'
else 'error'
end result
from (select 1 flag1, 0 flag2, 1 flag3 from table)

is there any function equal to bin_to_num?
Thanks in advance
 
bin_to_num converts a binary vector to ist equivalent number: bin_to_num(0,0,1)=1, bin_to_num(0,1,0)=2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top