Am looking for a query to sum values in a particular time duration say an year or a particular month in an year using MySQL syntax. Note that my transaction_date column stores daily amount transacted.
Am example of a query that returns total sales in an year query would look something like this
SELECT SUM(transaction_amount) WHERE transaction_date = (YEAR)
Am example of a query that returns total sales in an particular month and year would look something like this
SELECT SUM(transaction_amount) WHERE transaction_date = (YEAR)(MONTH)
How achievable is this?