SQL 存储过程如何赋值
Fraction --每个人语文分数字段int 形
- SQL code
declare @num int --总数set @num= select sum(Fraction) from Student where names='小红'
总说 关键字 'select' 附近有语法错误。
怎么回事,总分数也查出来了,网上赋值也是这样的,到底错在哪里了?
[解决办法]
- SQL code
declare @num int --总数select @num= sum(Fraction) from Student where names='小红'
[解决办法]
- SQL code
declare @num int --总数set @num= (select sum(Fraction) from Student where names='小红')