We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
select fecha, trabajos, numero, a.name
from
(
select fecha, max(trabajos) trabajos, min(numero) numero
from
(
select a.submission_date fecha,
count(a.submission_date) trabajos,
a.hacker_id numero
from
(
SELECT hacker_id id,
COUNT(DISTINCT submission_date) AS total
FROM Submissions
GROUP BY hacker_id
HAVING COUNT(DISTINCT submission_date) =
(SELECT COUNT(DISTINCT submission_date) FROM Submissions)
) temp
inner join Submissions a
on a.hacker_id = temp.id
where temp.total =
(select count(distinct submission_date) from Submissions)
group by a.hacker_id, a.submission_date
) temp2
group by fecha
) temp3
inner join Hackers a on
a.hacker_id = temp3.numero
order by fecha;
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
15 Days of Learning SQL
You are viewing a single comment's thread. Return to all comments →
Hi, where's my problem?
select fecha, trabajos, numero, a.name from ( select fecha, max(trabajos) trabajos, min(numero) numero from ( select a.submission_date fecha, count(a.submission_date) trabajos, a.hacker_id numero from ( SELECT hacker_id id, COUNT(DISTINCT submission_date) AS total FROM Submissions GROUP BY hacker_id HAVING COUNT(DISTINCT submission_date) = (SELECT COUNT(DISTINCT submission_date) FROM Submissions) ) temp inner join Submissions a on a.hacker_id = temp.id where temp.total = (select count(distinct submission_date) from Submissions) group by a.hacker_id, a.submission_date ) temp2 group by fecha ) temp3 inner join Hackers a on a.hacker_id = temp3.numero order by fecha;