我有 3 张桌子,College、Student 和 Result
create table college
(
clg_id int,
clg_name varchar2()50,
insert into college values(1,'GIFT');
insert into college values(2,'GITA');
insert into college values(3,'MIT');
create table student
(
clg_id int,
regno int,
sname varchar2(50)
)
insert into student values(1,10,sahar);
insert into student values(2,11,raj);
insert into student values(3,12,Payal);
insert into student values(3,13,Monalisha);
insert into student values(2,14,mary);
create table Result
(
clg_id int,
sname varchar2(50),
clg_name varchar2(50),
regno int,
dt date,
result varchar2(30)
)
insert into Result values(1,'sahar',10,'GIFT',20-02-1990,'A+');
insert into Result values(2,'raj',11,'GITA',21-02-1991,''B+);
insert into Result values(3,'monalisha',13,'MIT',22-09-2005,'A++');
insert into Result values(3,'payal',14,'MIT',22-09-2005,'C');
我想从浏览器中给出一个特定的dt
和clg_id
显示result
,学生姓名,大学名称以及regno
结果存储的日期。
例如:我将输入clg_id = 3
,dt = 22-09-2005
然后它应该显示:
clg_name sname regno result
MIT monalisha 13 A++
MIT payal 14 C
我尝试了很多...我的尝试之一是
SELECT college.clg_name,student.sname,
student.regno result.result FROM college,student,result
WHERE college.clg_id=student.clg_id=result.date;
但这是错误的......请帮忙。