Friday, September 27, 2013

Max Value from Zero (Positive or Negative) Help

Hi,


You have just to use the ABS function and compare .


Do you mean something like this:


create table #table1 (val1 int)

insert into #table1 values(1)

insert into #table1 values(60)

insert into #table1 values(-15)

insert into #table1 values(-130)

insert into #table1 values(120)

select max(abs(val1)) from #table1





No comments:

Post a Comment