Skip to content

Instantly share code, notes, and snippets.

@goggin13
Last active May 1, 2018 21:49
Show Gist options
  • Save goggin13/d54ed675e9aebd4b162cc36260500c95 to your computer and use it in GitHub Desktop.
Save goggin13/d54ed675e9aebd4b162cc36260500c95 to your computer and use it in GitHub Desktop.
select
payment_instrument_detail_type,
M.company_name,
M.public_id,
merchant_fk,
count(*)
from gateway_production.transactions T
inner join gateway_production.merchants M ON
T.merchant_fk = M.pk
where
T.created_at > '2018-04-10 00:00:00'
and T.created_at < '2018-04-24 23:59:00'
and T.payment_instrument_detail_type = 'AndroidPayCardDetail'
group by 1,2,3,4
order by 1,COUNT(*) DESC
limit 10
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment