Re: SQL Script

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: lonh SENG <slonh(at)camgsm(dot)com(dot)kh>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: SQL Script
Date: 2002-01-30 02:14:15
Message-ID: 20020129180955.B97423-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql


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;

In response to

  • SQL Script at 2002-01-30 01:12:32 from lonh SENG

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message lonh SENG 2002-01-30 03:37:41 Re: SQL Script
Previous Message David Stanaway 2002-01-30 02:08:23 Re: [ADMIN] SQL Script

Browse pgsql-sql by date

  From Date Subject
Next Message lonh SENG 2002-01-30 03:37:41 Re: SQL Script
Previous Message David Stanaway 2002-01-30 02:08:23 Re: [ADMIN] SQL Script