Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
608 B
1
Indexable
Never
SELECT submission_date,(SELECT COUNT(DISTINCT hacker_id) FROM submissions B  
WHERE A.submission_date = B.submission_date AND (SELECT COUNT(DISTINCT C.submission_date) FROM Submissions C WHERE B.submission_date > C.submission_date AND B.hacker_id = C.hacker_id) = dateDIFF(A.submission_date , '2016-03-01')) ,
(SELECT hacker_id FROM submissions B WHERE B.submission_date = A.submission_date GROUP BY hacker_id ORDER BY COUNT(submission_id) DESC , hacker_id LIMIT 1) AS temp,
(SELECT name FROM hackers where hacker_id = temp)
FROM (SELECT DISTINCT submission_date FROM submissions) A GROUP BY submission_date;