sql - get only month and year from date -


i want year, , numeric month date, try month char month, how can numeric month, , year ?

select to_char(dateper,'mon')  calcul  group dateper 

you can numeric representation in string using:

select extract(year dateper) yyyy, extract(month dateper) mm calcul group yyyy, mm; 

or:

select to_char(dateper, 'yyyy-mm')  calcul group to_char(dateper, 'yyyy-mm') ; 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -