SELECT
Sum(Earning) AS Amount,
MONTH(DateCreated) AS Month
FROM
TheTable
WHERE
DateCreated
BETWEEN
@DateFrom AND @DateTo
GROUP BY **???**
I want to display Earning per month and it should not group the month if it appears next year again e.g.
May, Jun, Jul, Aug, Sep, Oct, Nov, Dec, Jan, Feb, Mar, Apr, May, June etc.
Meaning if the year differs it should continue the list without grouping e.g. May 2015 and May 2016 altogether.
Thank you
MySQLorSQL Server? - 1000111