Count columns according to dates in SQL

前端 未结 3 879
说谎
说谎 2021-01-22 10:55

I need help with a SQL statement. The goal is to count the amount of alarms of each date. My table looks something like this:

|----DATE----|---COUNTER---|---ALAR         


        
3条回答
  •  爱一瞬间的悲伤
    2021-01-22 11:30

    Try this instead

    SELECT date, SUM(counter) FROM all_stats GROUP BY date;
    

    "GROUP BY date" puts all the individual dates on a separate line and does the sum separately per date.

提交回复
热议问题