1SELECT value1, extract(YEAR FROM my_date)
2FROM my_table
3GROUP BY value1, extract(YEAR FROM my_date);
1Select count(1), country_of_sale, to_char(datefield, 'YYYY-MM') AS yyyymm
2from table
3where country_of_sale IN ('USA', 'EUROPE', 'ASIA')
4group by country_of_sale, to_char(datefield, 'YYYY-MM')
5order by to_char(datefield, 'YYYY-MM');