pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pedro Doria Meunier <pdoria@netmadeira.com>
To: pgsql-general@postgresql.org
Subject: help with a query
Date: Fri, 3 Nov 2006 20:29:16 -0000
Message-ID: <004b01c6ff86$bc254ee0$23d6bed5@oem41cbbf9e178> (raw)

Hi all!

 

This is most certainly a lame question but perhaps someone is gracious
enough to lend me a hand. ;-)

 

I have the following setup in a table:

 

The first record which is to be found (ok easy enough :D) with a timestamp
meets a certain condition (ignition off)

The following record is for the event of ignition on again with a timestamp.

 

So the question here is: how can I compute the time difference between these
two records in a single query?

Better yet: finding all the records that meet the first condition (ignition
off) and the immediately following records as to compute the time
difference. ;-)

 

Thanks in advance!

 

 

Pedro Doria Meunier

(351) 91 302 49 72 - (351) 96 247 99 12

pdoria@netmadeira.com

MSN - pdoriam@hotmail.com

ICQ - 308-182-126

Skype: pdoriam

 

view thread (16+ messages)  latest in thread

Message-ID: <004b01c6ff86$bc254ee0$23d6bed5@oem41cbbf9e178>
Permalink:  ../004b01c6ff86$bc254ee0$23d6bed5@oem41cbbf9e178/
Also on:    postgresql.org/message-id/004b01c6ff86$bc254ee0$23d6bed5@oem41cbbf9e178

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: pdoria@netmadeira.com
  Subject: Re: help with a query
  In-Reply-To: <004b01c6ff86$bc254ee0$23d6bed5@oem41cbbf9e178>
  References: <004b01c6ff86$bc254ee0$23d6bed5@oem41cbbf9e178>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox