DECLARE @YearNum int = 2022 select year(creationdate) , ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Ubuntu

Q&A for Ubuntu users and developers

DECLARE @YearNum int = 2022

select year(creationdate)
  , PostTypeId
  , count(PostTypeId) type_count
from posts
where year(creationdate) = @YearNum
group by year(creationdate)
  , PostTypeId
order by count(PostTypeId)

Enter Parameters

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