declare @list table
(
Id int,
Name navarchar(12)
)
insert into @list
select * from tableA
select * from @list --到这步都是OK的,能得到@list中的数据
--下面我想把@list与tableB表联接起来做查询
select * from @list,tableB
where @list.id = tableB.id
结果报错了,提示上面where语句中的@list有问题:Must declare the scalar variable "@list".
这是为什么呢?我不是已经都定义了吗?