我需要你的帮助
我在mssql server database中有这些表:
match
---------------
matchid int;
palyerA_fk int;
playerB_fk int;
playerA_scores int;
playerB_scores int;
players
---------------
id int;
fullname nvarchar;
我需要这个观点:
Resultsview
----------------
PlayerA_fullname
PalyerA_scores
PlayerB_fullname
PlayerB_scores
请帮我创建该视图,谢谢
。
此查询未返回任何行:
select a.fullname as playerAfullname , b.fullname as playerBfull name ,
match.playerA_scores , match.playerB_scores
from match
inner join players as a on match.palyerA_fk = a.id
inner join players as b on match.palyerB_fk = b.id
答案 0 :(得分:1)
检查
select a.fullname as playerAfullname , b.fullname as playerBfullname ,
m.playerA_scores , m.playerB_scores
from match as m
inner join players as a on m.palyerA_fk = a.id
inner join players as b on m.palyerB_fk = b.id