首页 新闻 会员 周边

SQL中如何求每一列的数据总和

0
悬赏园豆:5 [已关闭问题] 关闭于 2013-09-01 09:23

sql语句

create table Students
(
    stu_id int identity(2010181001,1) not null primary key,
    stu_name varchar(12) not null,
    stu_age int not null,
    stu_math int not null,
    stu_english int not null,
    stu_chinese int not null,
    stu_score int null
);
insert into Students values('张三',18,88,99,67);
insert into Students values('李四',15,78,99,87);
insert into Students values('王五',21,68,99,77);
insert into Students values('找六',15,58,99,87);

现在想写条查询语句,查询所有信息,stu_score是stu_math,stu_english,stu_chinese三项的总和

select stu_id as 学号,stu_name as 姓名,stu_age as 年龄,stu_math as 数学,stu_english as 英语,stu_chinese as 语文,stu_score   from Students;

                                      stu_score该怎么写呢?

种花生的读书人的主页 种花生的读书人 | 菜鸟二级 | 园豆:208
提问于:2013-09-01 09:19
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册