Skip to content

Instantly share code, notes, and snippets.

@soandos
Created June 6, 2014 15:30
Show Gist options
  • Select an option

  • Save soandos/b7cb0a97d38ef4b20298 to your computer and use it in GitHub Desktop.

Select an option

Save soandos/b7cb0a97d38ef4b20298 to your computer and use it in GitHub Desktop.
Get true referral count
select
substring(source_name, 1, 14) as sourceNum,
count(*) as Number
from
data.mcomm
where
source_type = 'Tell A Friend'
group by substring(source_name, 1, 14)
having count(*) > 1
order by count(*);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment