Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- FLOOR(TIMESTAMPDIFF(HOUR, "2017-03-22 18:29:59", visit.date_created)/24) as dayofweek,
- DAYOFWEEK(visit.date_created) day_num,
- @rownum := @rownum + 1 as date_created_set_av,
- count(distinct(visit.pkey)) AS Visits,
- sum(revenue) AS Revenue,
- sum(revenue) / count(distinct(visit.pkey)) as EPC
- FROM lazysauce_20.visit, lazysauce_20.action cross join (select @rownum := 0) r
- WHERE visit.pkey=action.pkey and (visit.is_bot = 0)
- AND visit.date_created >="2017-03-22 18:29:59" and visit.date_created <="2017-03-23 18:29:59" AND TIME(visit.date_created)<="14:29:59"
- GROUP BY dayofweek order by day_num
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement