Re: Fwd: Ask for a question

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Fwd: Ask for a question
Date: 2015-01-21 18:23:23
Message-ID: 54BFEE9B.3060802@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 01/21/2015 11:02 AM, Pierre Hsieh wrote:
> Hi Raymond,
>
> Thanks for your reply. Please see detail as following. Thanks again.
>
> Pierre
>
>
> Inline image 1
>
> On Thu, Jan 22, 2015 at 1:48 AM, Raymond O'Donnell <rod(at)iol(dot)ie
> <mailto:rod(at)iol(dot)ie>> wrote:
>
> On 21/01/2015 17:32, Pierre Hsieh wrote:
> > Hi guys,
> >
> > Thanks for your replies.
> >
> > I certainly can use VBA and ADODB object in Excel to do it. Due to
> > performance, I wanna try to do it by SQL command in PG. However,
> I am
> > not expert in PG, so I need few help from your guys. Let me to
> describe
> > my question clearly as following.
> >
> > The final results which I wanna get
> > are STDDEV(a1,a2,a3,...), STDDEV(b1,b2,b3,...), ..etc. I
> definitely know
> > how to use standard deviation function in PG, but the critical
> problem
> > for me is how to calculate a1, a2, a3, b1, b2, b3...etc. The rule to
> > calculate them is a little complicated because it needs not only
> moving
> > window function but also few logical rules. Please see details as
> > following or attachment. I put some colors in rules. Hopefully, it's
> > easier for you guys to read them. Thanks
>
> Sorry, either I'm being stupid or your description isn't clear.
> Can you
> show your table structure, ideally with some sample data, and what you
> hope to get from the query?
>
> Ray.
>
>
> --
> Raymond O'Donnell :: Galway :: Ireland
> rod(at)iol(dot)ie <mailto:rod(at)iol(dot)ie>
>
>
>
>
If you have a four column table as defined in your spreadsheet, with
column names A,B,C,D
select rowsum = B - (C*A) +D;
might get you the sums you need but I don't understand the grouping of
these for the STDDEV function

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Paul Jungwirth 2015-01-21 18:24:15 Re: Fwd: Ask for a question
Previous Message Paul Jungwirth 2015-01-21 18:15:10 Re: Fwd: Ask for a question