SELECT * FROM( SELECT ROW_NUMBER() OVER(ORDER BY COUNT(1)...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Korean Language

Q&A for linguists, teachers and students of the Korean language

SELECT *
FROM(
SELECT
ROW_NUMBER() OVER(ORDER BY COUNT(1)  DESC) rn
,t.tagname
,COUNT(1) AS post_count
FROM tags t
JOIN posttags pt
ON t.id = pt.tagid
JOIN posts p
ON pt.postid = p.id
WHERE YEAR(p.creationdate) = '2023'
GROUP BY t.tagname) s
where s.rn <= 5
GROUP BY s.rn ,s.tagname, s.post_count
ORDER BY COUNT(1) DESC

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results