turbot/nba

Query: nba_team_total_wins

Usage

powerpipe query nba.query.nba_team_total_wins

SQL

select
'Total Wins' as label,
sum(case when wl_home = 'W' then 1 else 0 end + case when wl_away = 'W' then 1 else 0 end) as value
from
game
where
team_id_home = $1 or team_id_away = $1;

Dashboards

The query is used in the dashboards: