-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from TeoMeWhy/feat/dota
Team matches
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
WITH tb_union AS ( | ||
|
||
SELECT match_id, | ||
start_time, | ||
radiant_team.*, | ||
true flIsRadiant | ||
FROM bronze.dota.matches | ||
|
||
UNION ALL | ||
|
||
SELECT match_id, | ||
start_time, | ||
dire_team.*, | ||
false flIsRadiant | ||
FROM bronze.dota.matches | ||
), | ||
|
||
tb_union_consolidate AS ( | ||
|
||
SELECT match_id AS idMatch, | ||
from_unixtime(start_time) AS dtMatch, | ||
team_id AS idTeam, | ||
name AS descTeamName, | ||
tag AS descTeamTag, | ||
logo_url AS urlteamLogo, | ||
flIsRadiant | ||
FROM tb_union | ||
WHERE team_id IS NOT NULL | ||
ORDER BY match_id, flIsRadiant | ||
|
||
) | ||
|
||
SELECT * | ||
FROM tb_union_consolidate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters