pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Aaron Bono <postgresql@aranya.com>
To: Becky Hoff <bhoff@standoninc.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Dividing results from two tables with different time frames
Date: Sun, 17 Sep 2006 11:16:03 -0500
Message-ID: <bf05e51c0609170916t4f7a1aafy2ab5e0f2eb5fd4b@mail.gmail.com> (raw)
In-Reply-To: <4B2BD8A084A0B442ABF42645DB572A5F28DD4D@fr-fs1.StandonInc.com>
References: <4B2BD8A084A0B442ABF42645DB572A5F28DD4D@fr-fs1.StandonInc.com>

On 9/15/06, Becky Hoff <bhoff@standoninc.com> wrote:
>
> What I'm trying to accomplish is to get two percentages.  Both have one
> element from one table divided by an element in the other table.
>
> sum(ds.pulled_loan_total)/sum(dr.loan_starting_balance +
> dr.loan_net_change)*100 as pulls_percent,
>
> and
>
> (sum(ds.renew_loan_amount)/sum(dr.loan_starting_balance +
> dr.loan_net_change))*100 as renew_percent,
>
> No matter which query I place them in it gives me the wrong data because
> of the time frames.  How can I get the correct data?
>

What time frames do you want?  Are you looking for daily, monthly or
something else?


==================================================================
   Aaron Bono
   Aranya Software Technologies, Inc.
   http://www.aranya.com
   http://codeelixir.com
==================================================================

view thread (4+ messages)  latest in thread

Message-ID: <bf05e51c0609170916t4f7a1aafy2ab5e0f2eb5fd4b@mail.gmail.com>
Permalink:  ../bf05e51c0609170916t4f7a1aafy2ab5e0f2eb5fd4b@mail.gmail.com/
Also on:    postgresql.org/message-id/bf05e51c0609170916t4f7a1aafy2ab5e0f2eb5fd4b@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: postgresql@aranya.com, bhoff@standoninc.com
  Subject: Re: Dividing results from two tables with different time frames
  In-Reply-To: <bf05e51c0609170916t4f7a1aafy2ab5e0f2eb5fd4b@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox