Home > database >  Postgresql database statistics, statistical data
Postgresql database statistics, statistical data

Time:09-27

Have such a list, such as:
The time value
The 2018-06-23 10:00:00 1
The 2018-06-23 10:02:00 1
The 2018-06-23 10:03:00 2
The 2018-06-24 10:00:00 1
The 2018-06-24 10:00:00 1
The 2018-06-24 10:00:00 1
The 2018-06-24 10:00:00 1
The 2018-06-25 10:02:00 1
The 2018-06-25 10:02:00 1
The 2018-06-25 10:02:00 1

In what way, can I get a press day statistical list (statistical value field), such as:
The 2018-06-23 4
The 2018-06-24 4
The 2018-06-25 3

CodePudding user response:

 select time: : date, the sum (value) from TB group by 1 

CodePudding user response:

Select split_part as fdate (ftime, "", 1), the sum (value) from table group by fdate
  • Related