A table with a string field where date is being stored (don't suggest me to change the field type. It will cause hazard).
+--+----------+------+
|id|date |amount|
+--+----------+------+
|1 |23-03-2014|5000 |
+--+----------+------+
|2 |25-03-2014|3000 |
+--+----------+------+
|3 |21-04-2014|3000 |
+--+----------+------+
|4 |25-04-2014|4000 |
+--+----------+------+
I want to write a model function which will return sum of amount grouped by month from the table. How should I do it? It will show output like
03 - 8000
04 - 7000