0

No bool (variable) in sybase I guess? Is there a workaround?

select @w=width, @h=height from Rectangles where id=1
select @a = @w * @h
select @isWide = @w > @h          -- doesn't work
Gary
  • 241
  • 2
  • 13

1 Answers1

1

The simpliest way is to use sign function Select @isWide = sign (@w - @h)

Or case statement Case when @w > @h then 1 else 0 end

Can't check myself because I hav't sybase db now.

kolchanov
  • 2,018
  • 2
  • 14
  • 32