关于更新表的问题?
想用下面的语句更新test表,可是不成功,红色部分出错,出现错误提示-----必须声明变量 '@mytable'。请高手帮忙看看。多谢
declare @mytable table ([no] char(10),[score] char(10))
insert into @mytable
select '1','1298' union all
select '2','1298' union all
select '3','1297' union all
select '4','1298'
update test set score =(select score from @mytable )
where test.no=@mytable.no
test表结构
no score
1 a
2 b
3 c
4 d
5 e