5

SQL学习--连接查询

 3 years ago
source link: https://fann.im/blog/2008/04/14/sql-study-select-2/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

SQL学习--连接查询

Apr 14, 2008

等值与非等值连接查询

select Student.*, SC.* from Student, SC where Student.Sno=SC.Sno;

select Student.sno,sname,ssex,sage,sdept,cno,grade from Student LEFT JOIN SC ON (Student.sno = SC.sno);
select FIRST.cno,SECOND.cpno from Course FIRST,Course SECOND where FIRST.Cpno = SECOND.Cno;

复合条件连接

select Student.Sno,Sname,Grade from Student,SC
where Student.Sno = SC.Sno AND
SC.Cno ='1' AND SC.Grade > 80;

select Student.Sno,Sname,Cname,Grade
from Student,SC,Course
where Student.Sno = SC.Sno AND SC.Cno = Course.Cno;

Was this page helpful?

</article


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK