Re: SUM all timeelapse WHERE timetype = 'Break' but only the rows that are after(below) timetype = 'Start'

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: litu16 <litumelendez(at)gmail(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: SUM all timeelapse WHERE timetype = 'Break' but only the rows that are after(below) timetype = 'Start'
Date: 2015-06-30 20:17:42
Message-ID: CAKFQuwYeui+hCsyK2H_QV-WUbDDnQRaVmCXq8TaXu-4YTaPaTw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Sun, Jun 28, 2015 at 1:56 AM, litu16 <litumelendez(at)gmail(dot)com> wrote:

>
> Pls I would like to know how to SUM THEM UP, not just SELECT THEM, hope
> some
> good PostgreSQL fellow programmer could give me a hand with it.
>
>
​http://www.postgresql.org/docs/9.4/interactive/functions-aggregate.html

Also see "GROUP BY"

Instead of showing a picture of a table you might get more help if you make
into into a VALUES-based CTE and incorporate it directly into an example
query.

WITH data AS ( VALUES (...),(...),(...) )
SELECT ...
FROM data
...

David J.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message xujian 2015-06-30 21:37:55 Re: Postgresql gss user map doesn't work
Previous Message xujian 2015-06-30 16:56:47 Postgresql gss user map doesn't work