Re: problem in sql - sum()

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: ivan(at)adicional(dot)com(dot)br
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: problem in sql - sum()
Date: 2016-03-22 20:15:53
Message-ID: CAKFQuwar07_3s0VD2=RQBFd+W0q3VbL2AaDXMzfWn2MTNhen_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Mar 22, 2016 at 7:42 AM, <ivan(at)adicional(dot)com(dot)br> wrote:

> Hi. I have a problem identified.
> In select :
>
> select data_carteira, sum(valor_carteira) from carteira where
> data_carteira between '2016-01-01' and '2016-02-18'
> GROUP BY data_carteira order by data_carteira
>
> return a values from month. In the day 18, return the value 82.915.213,14.
>
>
​​Which day 18?​

> Now, if I use the select :
> select data_carteira, sum(valor_carteira) from carteira where
> data_carteira='2016-01-18'
> GROUP BY data_carteira order by data_carteira
>
> return 103.629.305,96.
>
> It's very diferenty.
> Only change is date.
>
> The version in use is :
> PostgreSQL 9.0.8 on x86_64-redhat-linux-gnu, compiled by GCC gcc (GCC)
> 4.6.3 20120306 (Red Hat 4.6.3-2), 64-bit
>

You are going to find little help here given you are running an ancient
and, even when within support, woefully unpatched release of the software.

​David J.​

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2016-03-22 20:25:27 Re: problem in sql - sum()
Previous Message xenophon 2016-03-22 18:28:31 BUG #14040: Cannot authenticate against Active Directory in search+bind mode using domain root naming context