Group by month in SQLite

前端 未结 6 719
礼貌的吻别
礼貌的吻别 2020-12-16 14:17

I have an SQLite database which contains transactions, each of them having a price and a transDate.

I want to retrieve the sum of the transactions

6条回答
  •  悲哀的现实
    2020-12-16 14:44

    You can group on the start of the month:

    select  date(DateColumn, 'start of month')
    ,       sum(TransactionValueColumn)
    from    YourTable
    group by 
            date(DateColumn, 'start of month')
    

提交回复
热议问题