Q&A for linguists, teachers and students of the Korean language
SELECT CAST(p.creationdate AS DATE) AS post_date ,t.tagname ,COUNT(*) AS post_count ,ROW_NUMBER() OVER (PARTITION BY CAST(p.creationdate AS DATE) ORDER BY COUNT(*) DESC) AS rn FROM tags t JOIN posttags pt ON t.id = pt.tagid JOIN posts p ON pt.postid = p.id WHERE YEAR(p.creationdate) = YEAR(SYSDATETIME()) GROUP BY t.tagname, CAST(p.creationdate AS DATE)