15 Days of Learning SQL

  • + 0 comments

    Can anyone tell why windows function is not working in below query?

    select t.submission_date, max(t.cnt) over (partition by t.submission_date) t.hacker_id,t.name from (select submission_date,count(*) as cnt,h.hacker_id,name from submissions s join hackers h on s.hacker_id = h.hacker_id group by submission_date,h.hacker_id,name having cnt > 0 order by submission_date) t