Re: [GENERAL] Average - Pg 9.2 - Mailing list pgsql-general

From David G. Johnston
Subject Re: [GENERAL] Average - Pg 9.2
Date
Msg-id CAKFQuwY9296wft2sAUzhGhtjj_1T_6Ur=F6ugBnBePQ1zFmddA@mail.gmail.com
Whole thread Raw
In response to [GENERAL] Average - Pg 9.2  (Patrick B <patrickbakerbr@gmail.com>)
List pgsql-general
On Thursday, February 2, 2017, Patrick B <patrickbakerbr@gmail.com> wrote:
Hi guys,

I've got a table which has id and created date columns.

I want to get the average of inserted rows monthly.
How can I get this data?

This query is not working as it is showing me same data in both columns.

select created_date,
AVG(id) 
OVER(ORDER BY created_date) AS avr from test



Maybe...see GROUP BY...

David J.

pgsql-general by date:

Previous
From: Patrick B
Date:
Subject: [GENERAL] Average - Pg 9.2
Next
From: Jong-won Choi
Date:
Subject: [GENERAL] Row level security policy - calling function for right hand sidevalue of 'in' in using_expression