Advertisement
Guest User

Untitled

a guest
Nov 13th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select datee,count(Dlog.id_for_vendor),count(Usub.id_for_vendor)
  2. ,cast(count(Usub.id_for_vendor) as float)/cast(count(Dlog.id_for_vendor) as float) as Ratio
  3. From
  4. (select distinct dil.id_for_vendor,date(dil.Original_purchase_timestamp) as datee
  5. FROM public.facetune2_device_info_log as dil
  6. where dil.Original_purchase_timestamp is not null
  7. order by dil.id_for_vendor) as Dlog left join public.Facetune2_usage_store_user_subscribed as Usub
  8. on (Dlog.id_for_vendor=Usub.id_for_vendor)
  9. group by datee
  10. order by datee;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement