Skip to content

Instantly share code, notes, and snippets.

@hissy
Created March 29, 2018 19:11
Show Gist options
  • Save hissy/86b5b430d8a85f7b5b5d8ecb3abd5b3e to your computer and use it in GitHub Desktop.
Save hissy/86b5b430d8a85f7b5b5d8ecb3abd5b3e to your computer and use it in GitHub Desktop.
#mautic #mysql Get most common page hits by specific segment users
select count(page_hits.url) as count, page_hits.url
from page_hits
left join leads on page_hits.lead_id = leads.id
left join lead_lists_leads on leads.id = lead_lists_leads.lead_id
left join lead_lists on lead_lists.id = lead_lists_leads.leadlist_id
where lead_lists.id = 31
group by page_hits.url
order by count desc
limit 10;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment