I am writing a stored procedure like this..
declare @avg float
set @avg = select avg(rating) from videorating where videoid = 4
Can I write it like this? Can I store the value in @avg?
I am writing a stored procedure like this..
declare @avg float
set @avg = select avg(rating) from videorating where videoid = 4
Can I write it like this? Can I store the value in @avg?
I would write it
declare @avg float
select @avg=avg(rating) from videorating where videoid = 4