Re: Dividing results from two tables with different time frames

Поиск
Список
Период
Сортировка
От Aaron Bono
Тема Re: Dividing results from two tables with different time frames
Дата
Msg-id bf05e51c0609170916t4f7a1aafy2ab5e0f2eb5fd4b@mail.gmail.com
обсуждение исходный текст
Ответ на Dividing results from two tables with different time frames  ("Becky Hoff" <bhoff@standoninc.com>)
Список pgsql-sql
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
==================================================================

В списке pgsql-sql по дате отправления:

Предыдущее
От: Joost Kraaijeveld
Дата:
Сообщение: Re: Transactional behaviour with trigger
Следующее
От: "James Im"
Дата:
Сообщение: inner join is much faster! is that right?