I want get only year, and only numeric month from date, I try this for month by i get char month, how can i get numeric month, and year ?
group by dateper
You can get a numeric representation in a string by using:
select extract(year from dateper) as yyyy, extract(month from dateper) as mm from calcul group by yyyy, mm;
select to_char(dateper, 'YYYY-MM') from calcul group by to_char(dateper, 'YYYY-MM') ;