I need to get a column value from a table on SQL server 2008.
DECLARE @result TABLE
(
val FLOAT
);
insert into @result (val)
(
select SUM(c)/10 val from atable
)
DECLARE @myval float
SELECT @myval = @result.val # error : Must declare the scalar variable "@result". !!!
if @myval = null
begin
select @myval
end
Why ?
thx !