简单的SQL语句

来源:百度知道 编辑:UC知道 时间:2024/05/31 02:33:40
DECLARE @j int
set @j=5
select top @j @i=stuNo from stuMarks where writeExam = 60

谁能告诉我这句SQL语句为什么会错的?TOP后面是不是不能用变量的?

@i=stuNo
这赋值语句只能查询结果为一条记录
你还用top????

select @j =stuNo from stuMarks where writeExam = 60
@i做是么用的 没有定义哦。

去掉top