pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Henry Ortega <juandelacruz@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Best way to do this query..
Date: Fri, 25 Aug 2006 16:16:07 -0400
Message-ID: <2bffcc330608251316g6ed00710u6e43b243800c6087@mail.gmail.com> (raw)

I have the following:

name      effective         tstamp                                   rate
John       01-01-2006     2005-12-07 13:39:07.614945    115.00
John       01-16-2006     2006-01-07 13:39:07.614945    125.00
John       01-16-2006     2006-01-09 15:13:04.416935    1885.00

I want the output to be:
name      effective         end_date        rate
John       01-01-2006     01-15-2006    115.00
John       01-16-2006                         1885.00

What is the best way to do this? This is on a huge table and what I
have right now is quite slow. Any ideas?

view thread (5+ messages)  latest in thread

Message-ID: <2bffcc330608251316g6ed00710u6e43b243800c6087@mail.gmail.com>
Permalink:  ../2bffcc330608251316g6ed00710u6e43b243800c6087@mail.gmail.com/
Also on:    postgresql.org/message-id/2bffcc330608251316g6ed00710u6e43b243800c6087@mail.gmail.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: juandelacruz@gmail.com
  Subject: Re: Best way to do this query..
  In-Reply-To: <2bffcc330608251316g6ed00710u6e43b243800c6087@mail.gmail.com>

* 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