Get team names with CTEs
You've now explored two methods for answering the question, How do you get both the home and away team names into one final query result?
Let's explore the final method - common table expressions. Common table expressions are similar to the subquery method for generating results, mainly differing in syntax and the order in which information is processed.
Bu egzersiz
Data Manipulation in SQL
kursunun bir parçasıdırUygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
SELECT
-- Select match id and team long name
___,
___ AS hometeam
FROM ___ AS m
-- Join team to match using team_api_id and hometeam_id
LEFT JOIN ___ AS t
ON ___ = ___;