Skip to content

Instantly share code, notes, and snippets.

@jthandy
Created April 6, 2016 19:14
Show Gist options
  • Save jthandy/853b87edc0018a44a74f8514e1d5fa8d to your computer and use it in GitHub Desktop.
Save jthandy/853b87edc0018a44a74f8514e1d5fa8d to your computer and use it in GitHub Desktop.
select all_months.date_month,
news.value as new,
renewals.value as renewal,
prepaids.value as committed,
churns.value * -1 as churned,
upgrades.value as upgrades,
downgrades.value as downgrades
from all_months
left outer join news on all_months.date_month = news.date_month
left outer join renewals on all_months.date_month = renewals.date_month
left outer join prepaids on all_months.date_month = prepaids.date_month
left outer join churns on all_months.date_month = churns.date_month
left outer join upgrades on all_months.date_month = upgrades.date_month
left outer join downgrades on all_months.date_month = downgrades.date_month
order by 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment