How to \'group by\' a query using an alias, for example:
select count(*), (select * from....) as alias_column from table group by alias_column
If you don't have to use an alias you could do it this way:
select EXTRACT(year from CURRENT_DATE), count(*) from something group by EXTRACT(year from CURRENT_DATE) order by EXTRACT(year from CURRENT_DATE)
Instead of using alias and subquery.