求一个SQL语句 - MS-SQL Server / 基础类
现有三张表
表A:学生ID、学生名
表B:课程ID、课程名
表C:学生ID、课程ID、成绩
如果想输出下列值:
参加了某门课程的所有学生的学生名、课程名、成绩
SQL语句该怎么写?用一句SQL语句能实现吗?
SQL code:
select a.学生名,b.课程名,c.成绩
from a ,b,c
where a.学生ID = c.学生ID and c.课程ID = b.课程ID and b.课程名 = '某门课程'
SQL code:
select
a.学生名,b.课程名,c.成绩
from
a,b,c
where
a.学生ID=c.学生ID
and
b.课程ID=c.课程ID
and
b.课程ID=xx
SQL code:
select
a.学生名,b.课程名,c.成绩
from
a,b,c
where
a.学生ID=c.学生ID
and
b.课程ID=c.课程ID
and
b.课程名='xx'
SQL code:
select a,学生名,b.课程名,c.成绩 from a join c on a.学生ID=c.学生ID join b on c.课程ID=b.课程ID where b.课程名='某门课程名'
SQL code:
select a.学生名,b.课程名,c.成绩 from a,b,c
where a.学生ID=c.学生ID and b.课程I
相关问答:
执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
今天做了一个存储过程 环境是SQL2000数据库
大致如下
建立临时表
定义员工游标
循环员工(属于1个公司)
......
字段1,字段2.....字段N,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
想要的结果是:
1,Na ......