我想从具有 HomeTeam 和 AwayTeam 字段的夹具表中获取俱乐部的夹具列表,但是当我搜索它时,它仅返回与搜索参数匹配的第一行。然而,当俱乐部在主场和客场比赛时,我想同时获得这两场比赛。这是我的程序
CREATE DEFINER=root
@localhost
PROCEDURE GetClubFixtures
(clubName varchar(45))
BEGIN
SELECT FixtureDate, Tournament, HomeTeam, AwayTeam, KickOff
FROM fixture
WHERE SeasonID in
(select SeasonID from season where seasonType=1)
and HomeTeam = ClubName
or AwayTeam=ClubName
ORDER BY FixtureDate;
只返回一行,如下图
'2013-05-15', 'FSL', 'Sports Club Victoria University', 'Villa Sports Club', 05:00:00