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

From David G. Johnston
Subject Re: SUM all timeelapse WHERE timetype = 'Break' but only the rows that are after(below) timetype = 'Start'
Date
Msg-id CAKFQuwYeui+hCsyK2H_QV-WUbDDnQRaVmCXq8TaXu-4YTaPaTw@mail.gmail.com
Whole thread Raw
In response to SUM all timeelapse WHERE timetype = 'Break' but only the rows that are after(below) timetype = 'Start'  (litu16 <litumelendez@gmail.com>)
List pgsql-admin
On Sun, Jun 28, 2015 at 1:56 AM, litu16 <litumelendez@gmail.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.



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.
 

pgsql-admin by date:

Previous
From: litu16
Date:
Subject: SUM all timeelapse WHERE timetype = 'Break' but only the rows that are after(below) timetype = 'Start'
Next
From: xujian
Date:
Subject: Re: Postgresql gss user map doesn't work