Jocelyn Badgley (Twipped) 131be58887 Some analtics work
2021-03-23 09:29:11 -07:00

23 lines
508 B
SQL

SELECT
date(dts) as day,
count(DISTINCT IFNULL(tid, ip)) as tids
FROM records
GROUP BY date(dts);
SELECT
(duration / 60) as minutes,
COUNT(IFNULL(tid,ip)) as total
FROM records
WHERE duration > 1 AND duration < (60 * 30)
GROUP BY duration / 60
HAVING total > 5;
SELECT referrer_host, count(DISTINCT IFNULL(tid, ip)) as tids, referrer
FROM records
GROUP BY referrer_host;
SELECT COUNT(IFNULL(tid,ip)) as total, referrer
FROM records
WHERE referrer_host LIKE '%reddit.com'
GROUP BY referrer