pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: lonh SENG <slonh@camgsm.com.kh>
Cc: pgsql-admin@postgresql.org
Subject: Re: SQL Script
Date: Tue, 29 Jan 2002 18:14:15 -0800 (PST)
Message-ID: <20020129180955.B97423-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <00ba01c1a92b$31c58280$05a00017@idlonh>


On Wed, 30 Jan 2002, lonh SENG wrote:

> Hi all,
>
>     I have one table containing data as "source.txt" attached file. I
> want to create a script to clean the data and get the result as
> "result.txt" attached file.
>     inbtime and inbtime1 is datetime data type.
>     Anyone has an idea?
>     Any help will be appreciated.
>     thanks in advance
>
>     Sorry. It seems to be out of the topic.

Probably belongs on pgsql-sql, but... :)

This is not at all optimized, but maybe something of the form:

select t1.card, t1.inbtime, coalesce((select min(inbtime) from t t2 where
t2.inbtime>t1.inbtime and t2.card=t1.card), t1.inbtime) from t t1;




view thread (4+ messages)  latest in thread

Message-ID: <20020129180955.B97423-100000@megazone23.bigpanda.com>
Permalink:  ../20020129180955.B97423-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020129180955.B97423-100000@megazone23.bigpanda.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 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-admin@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, slonh@camgsm.com.kh
  Subject: Re: SQL Script
  In-Reply-To: <20020129180955.B97423-100000@megazone23.bigpanda.com>
  References: <00ba01c1a92b$31c58280$05a00017@idlonh> <20020129180955.B97423-100000@megazone23.bigpanda.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