2012-06-28

TSQL - How to get the lowest of two values 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