Advertisement
Guest User

Untitled

a guest
Feb 17th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. SELECT UPPER(wmf_last_access) AS last_seen_date,
  2. (unix_timestamp(CONCAT(year,'-',LPAD(month,2,'0'),'-',LPAD(day,2,'0')), 'yyyy-MM-dd') - 1483228800)/86400 AS days_till_next_access,
  3. SUM(view_count) AS frequency
  4. FROM zareen.webrequest_extract
  5. WHERE wmf_last_access IS NOT NULL
  6. AND UPPER(wmf_last_access) = '2017-JAN-01'
  7. AND year = 2017
  8. AND month = 1
  9. AND day < 9
  10. AND unix_timestamp(CONCAT(year,'-',LPAD(month,2,'0'),'-',LPAD(day,2,'0')), 'yyyy-MM-dd') >= 1483315200
  11. GROUP BY UPPER(wmf_last_access)
  12. ORDER BY last_seen_date, days_till_next_access LIMIT 1000;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement