select imprint_year, count(*) as ct from ( SELECT pi_year.value as imprint_year, pi_season.value as imprint_season from habari__posts p INNER join habari__posttype pt on p.content_type = pt.id and pt.name = 'page' INNER join habari__postinfo pi_year on p.id = pi_year.`post_id` and pi_year.name = 'year' INNER join habari__postinfo pi_season on p.id = pi_season.`post_id` and pi_season.name = 'season' INNER JOIN habari__poststatus ps on p.status = ps.id and ps.name = 'published' ORDER BY pi_year.value DESC, pi_season.value ASC limit 1, 15 ) imprint_data group by imprint_year order by imprint_year DESC LIMIT 3