0
选择多个相应的行您好,我有两个表betting_match和betting_teams:从另一个表
,我想选择比赛和也选择相匹配的相应的团队。
例如这样的选择数据:
ID | BetradarMatchId | betting_tournament_id | Team1 | Team2
1 4 3 Barca Real
其中巴萨和皇家来自betting_teams表。
我试图使用查询,但这是行不通的。
SELECT
matches.id,
matches.BetradarMatchId,
matches.betting_tournament_id,
teams.title as Team1,
teams.title as Team2
FROM
betting_match matches
LEFT JOIN
betting_teams teams
ON
teams.id = matches.betting_teams_id
OR
teams.id = matches.betting_teams_id1
WHERE
matches.status != 0
AND
matches.top = 1
GROUP BY
matches.id
什么是不使用它?是否有错误反馈或仅显示错误数据?另外,为什么GROUP BY没有聚合? – Utrolig