I have table "TableHome", column name "Date" in database "DatabaseHome.db" contains data like this
5 January 2021
6 October 2021
10 December 2021
I want to take the month name for each year to generate monthly statistics, what sytax should I use in sql? and how to have that data converted into arraylist in java without duplicate items?
2
Answers
To convert the above dates to month int values use
To summarise for a month you need to sum(or count depending what you want) and group by column one,
so something like
You should try with
MONTHNAME(DATE)
to get Month in String andDISTINCT
to remove dupilcate itemsdbfiddle here