tekartik / sqflite

SQLite flutter plugin
BSD 2-Clause "Simplified" License
2.87k stars 524 forks source link

How to Group List by Date? #598

Open MALLORY8K opened 3 years ago

MALLORY8K commented 3 years ago

How i can Grou List by Date?

abraaoribeiro commented 3 years ago

Hi see if it helps you, just replace the parameters.

 SELECT 
           CAST(strftime('%Y', dateTransaction) as INTEGER) as timestamp, 
          sum(classe.price) as total  
         FROM  
           expense 
         GROUP by 
           CAST(strftime('%Y', dateTransaction) as INTEGER);