From b49506c4cc0c79dc90e9ad238bb113e2a20a4fc7 Mon Sep 17 00:00:00 2001 From: sush <59618780+sush-101@users.noreply.github.com> Date: Wed, 23 Sep 2020 02:29:04 +0530 Subject: [PATCH] Update 06_the_join_operation.sql --- 06_the_join_operation.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/06_the_join_operation.sql b/06_the_join_operation.sql index fa1cde1..20d946a 100644 --- a/06_the_join_operation.sql +++ b/06_the_join_operation.sql @@ -85,6 +85,6 @@ SELECT mdate, SUM(CASE WHEN teamid=team1 THEN 1 ELSE 0 END) score1, team2, SUM(CASE WHEN teamid=team2 THEN 1 ELSE 0 END) score2 -FROM game JOIN goal ON goal.matchid = game.id +FROM game LEFT JOIN goal ON goal.matchid = game.id GROUP BY game.id ORDER BY mdate, matchid, team1, team2