Re: [GENERAL] Single Table Report With Calculated Column

2014-08-29 Thread Adrian Klaver
On 08/29/2014 10:15 AM, Rich Shepard wrote: On Fri, 29 Aug 2014, Adrian Klaver wrote: I am going to assume you mean Postgres did not like the syntax. Adrian, Oops! Mea culpa. Yes, postgres. What was the error message you got back? I don't recall. It was yesterday afternoon and I fl

Re: [GENERAL] Single Table Report With Calculated Column

2014-08-29 Thread Rich Shepard
On Fri, 29 Aug 2014, Adrian Klaver wrote: I am going to assume you mean Postgres did not like the syntax. Adrian, Oops! Mea culpa. Yes, postgres. What was the error message you got back? I don't recall. It was yesterday afternoon and I flushed it from memory when it did not work. Ric

Re: [GENERAL] Single Table Report With Calculated Column

2014-08-29 Thread Adrian Klaver
On 08/29/2014 09:50 AM, Rich Shepard wrote: On Fri, 29 Aug 2014, David G Johnston wrote: You want to use window clause/function. David, I read about this, but did not absorb everything. Add the following to the first query, in the select-list: Sum(count(*)) over (partition by stream, sa

Re: [GENERAL] Single Table Report With Calculated Column

2014-08-29 Thread Rich Shepard
On Fri, 29 Aug 2014, David G Johnston wrote: You want to use window clause/function. David, I read about this, but did not absorb everything. Add the following to the first query, in the select-list: Sum(count(*)) over (partition by stream, sampdate) as stream_date_total You function coun

Re: [GENERAL] Single Table Report With Calculated Column

2014-08-29 Thread David G Johnston
Rich Shepard wrote > I've read some on table partitioning and using nested select statements > with group by, but have not found the syntax to produce the needed > results. > >From a table I extract row counts grouped by three columns: > > select stream, sampdate, func_feed_grp, count(*) from