SHARE
TWEET

Untitled

a guest Feb 17th, 2017 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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;
RAW Paste Data
Top