Re: [GENERAL] Inconsistent results postgresql

2014-07-31 Thread Kevin Grittner
Chris Curvey wrote: > Emir Ibrahimbegovic wrote: >> So looking for same date using different date range I get >> different results, how is this even possible? Can I look at >> something else? I'm really stuck here > Remove the sum (just select "payments.amount") and the GROUP BY > and run your

Re: [GENERAL] Inconsistent results postgresql

2014-07-31 Thread Emir Ibrahimbegovic
Yes there was some users subscribed at different date than payment was made. So I used this to get the results on the daily basis : SELECT date_trunc('day', payments.created_at) "day", SUM("payments"."amount") AS sum_id FROM "payments" INNER JOIN "users" ON "users"."id" = "payments"."user_id" WH

Re: [GENERAL] Inconsistent results postgresql

2014-07-31 Thread Adrian Klaver
On 07/31/2014 05:44 AM, Emir Ibrahimbegovic wrote: Thank you for your response guys. So, did you find the cause? -- Adrian Klaver adrian.kla...@aklaver.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/ma

Re: [GENERAL] Inconsistent results postgresql

2014-07-31 Thread Emir Ibrahimbegovic
Thank you for your response guys. On Wed, Jul 30, 2014 at 9:25 PM, Chris Curvey wrote: > > > > On Wed, Jul 30, 2014 at 8:41 PM, Emir Ibrahimbegovic < > emir.ibrahimbego...@gmail.com> wrote: > >> Hello all, >> >> I've got two queries which should produce the same results but they don't >> for so

Re: [GENERAL] Inconsistent results postgresql

2014-07-30 Thread Chris Curvey
On Wed, Jul 30, 2014 at 8:41 PM, Emir Ibrahimbegovic < emir.ibrahimbego...@gmail.com> wrote: > Hello all, > > I've got two queries which should produce the same results but they don't > for some reason, please consider these : > > SELECT date_trunc('day', payments.created_at) "day", SUM("payments"

Re: [GENERAL] Inconsistent results postgresql

2014-07-30 Thread David G Johnston
Emir Ibrahimbegovic wrote > Hello all, > > I've got two queries which should produce the same results but they don't > for some reason, please consider these : > > SELECT date_trunc('day', payments.created_at) "day", > SUM("payments"."amount") AS sum_id FROM "payments" > INNER JOIN "users" ON "

[GENERAL] Inconsistent results postgresql

2014-07-30 Thread Emir Ibrahimbegovic
Hello all, I've got two queries which should produce the same results but they don't for some reason, please consider these : SELECT date_trunc('day', payments.created_at) "day", SUM("payments"."amount") AS sum_id FROM "payments" INNER JOIN "users" ON "users"."id" = "payments"."user_id" WHERE "