java - Get the months name for the a particular date range -


i have date range '2015/01/01' '2015/12/31'. database has date,device_id columns of table "device".

from date range want display month-name , № of unique device_ids in month. e.g, database having date , devie_id 2 columns

date        device_id  2015-01-01     1 2015-01-20     1 2015-03-01     1 2015-03-01     3 2015-04-01     2 2015-06-01     3 2015-08-01     4 2015-09-01     1 

expected result

month   device_count january      1 march        2 april        1 june         1 august       1 september    1 

how bring month name? using java class retrive data.

below image clear idea of result needed

enter image description here

select month(date),count(distinct device_id) table_name group month(date); 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -