
uj5u.com熱心網友回復:
select a.*,b.score as EnglishScore,c.score as MathScore from student aleft join EnglishScore b on a.id=b.stnum
left join MathScore c on a.id=c.stnum
uj5u.com熱心網友回復:
SELECT students.* ,
EnglishScore.score AS EnglishSroce ,
MathScore.score AS MathScore
FROM students
JOIN EnglishScore ON EnglishScore.stnum = students.id
JOIN MathScore ON MathScore.stnum = students.id
WHERE students.id = 15001
uj5u.com熱心網友回復:
select b.stnum,a.name,b.socre as englishscore,c.score as mathscore
from student a left join Englishscore b on a.id=b.stnum --通過student表的id跟englishscore表的stnum連接得出每個學生的英語成績
left join mathsocre c on a.id=c.stnum --通過student表的id跟mathscore表的stnum連接得出每個學生的數學成績
where a.id=1
看看join語法就會明白了
http://www.w3school.com.cn/sql/sql_join.asp
uj5u.com熱心網友回復:
結帖率:0%當您的問題得到解答后請及時結貼.
http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
http://topic.csdn.net/u/20100428/09/BC9E0908-F250-42A6-8765-B50A82FE186A.html
http://topic.csdn.net/u/20100626/09/f35a4763-4b59-49c3-8061-d48fdbc29561.html
8、如何給分和結貼?
http://bbs.csdn.net/help#post_dispose
uj5u.com熱心網友回復:
select EnglishScore.strNum,students.name,EnglishScore.score as EnglishScore,MathScore.score as MathScorefrom students,EnglishScore,MathScore
where students.id=15001 and MathScore.strnum=15001 and English.strnum=15001
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/107974.html
標籤:MySQL
