sql server - IF ELSE error in sql -


this code; should print 'buy' prints 'none'. doesn't give ideas.

what do?

declare @avg8 decimal(18,4) declare @avg3 decimal(18,4) set @avg8=32.4 set @avg3=31.5      if @avg3 >= @avg8         begin         print n'buy';         end     else     begin         if @avg3<@avg8             begin                    print n'sell';             end         else             begin             print n'none';             end     end 

please help.

why print buy - have this: set @avg8=32.4 set @avg3=31.5

if @avg3 >= @avg8     begin     print n'buy'; 

where @avg3 isn't greater @avg8


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -