May 2020
Beginner
564 pages
14h 9m
English
If you run the same query from the last section on UNION with UNION ALL instead, you will get the same results because there weren't any duplicates to filter out.
You can use the following new query to see how UNION ALL works by removing duplicates:
SELECT playerid, yearid, teamid, G AS gamesbatted FROM lahmansbaseballdb.battingWHERE yearid = 2005UNION ALL SELECT playerid, yearid, teamid, g_batting FROM lahmansbaseballdb.appearances WHERE yearid = 2005 ORDER BY yearid, playerid, gamesbatted;
The previous query will give us the results shown in the following screenshot:

From the preceding screenshot, we can make the following observations: ...
Read now
Unlock full access