jeudi 13 août 2015

SUM of total per month

I have this table with two columns:

Price       Date
45.00       12/06/2015 12:32:54 AM
455.98      22/06/2015 11:00:32 AM
32.00       08/07/2015 09:11:45 AM
98.00       11/07/2015 19:22:32 PM

(the date is in the format DD/MM/YYYY)

I need to get the sum of prices grouped by month and for this I need to find a code in sqlite that cut some parts of that date only getting the month (...06...)(...07...). Below is my code used for some parts of the SELECT:

SELECT SUM(CAST(price as INTEGER)) as TOTALPERMONTH FROM cart_history GROUP BY ....... ORDER BY ID

How I can grouped by some parts of that row?

Aucun commentaire:

Enregistrer un commentaire