Untitled

 avatar
user_8556937499
plain_text
2 years ago
568 B
3
Indexable
Never
SELECT DISTINCT(submission_date), 
(SELECT COUNT(DISTINCT(hacker_id)) FROM Submissions WHERE submission_date=s.submission_date),
(SELECT hacker_id FROM Submissions WHERE s.submission_date=submission_date GROUP BY hacker_id ORDER BY COUNT(*) DESC, hacker_id ASC LIMIT 1),
(SELECT name FROM Hackers WHERE exists (SELECT hacker_id FROM Submissions WHERE Hackers.hacker_id=hacker_id AND s.submission_date=submission_date GROUP BY hacker_id ORDER BY COUNT(*) DESC, hacker_id ASC LIMIT 1) ORDER BY hacker_id ASC LIMIT 1)
 FROM Submissions s ORDER BY submission_date ASC;