Q&A for Ubuntu users and developers
select pt.name, count(*) from posts p join posttypes pt on p.posttypeid=pt.id where year(creationdate)=2022 group by pt.name order by pt.name;