如果我有这两个表:如何从两个表中选择?
table_user
Id name lname
1 Mark Brown
2 Martha Fox
table_score_start:
user_Id score
2 5
table_score_last:
user_Id score
1 3
2 4
我如何可以显示下面的查询结果呢?
ID名称LNAME得分得分 1马克·布朗3 2玛莎·福克斯5 4
我试图
SELECT table_user.Id, table_user.name, table_user.lname, table_score_start.score,
table_score_last.score FROM table_user, table_score_start, table_score_last
但它不工作
我也试过
SELECT table_user.Id, table_user.name, table_user.lname, table_score_start.score,
table_score_last.score FROM table_user, table_score_start, table_score_last WHERE table_user.Id = table_score_start.user_Id
我想要显示所有的记录认为包括那些不是在一个或两个表的表table_score_start和table_score_last
什么是错误?或者只是空的结果? – powtac 2013-05-10 18:59:47
@ antonioj1015做一个好的支持者。开始接受答案。 – 2013-05-11 09:27:59
你解决了你的问题吗? – 2013-06-12 22:42:00