2012-06-28

TSQL - Greatest of two numbers using arithmetic


declare @val1 as float;
declare @val2 as float;
set @val1=3.1;
set @val2=3;
select 0.5 * ((@val1 + @val2) + abs(@val1 - @val2));


No comments:

Post a Comment