Re: SQL Script

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: SQL Script
Дата
Msg-id 20020129180955.B97423-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на SQL Script  ("lonh SENG" <slonh@camgsm.com.kh>)
Ответы Listing Triggers  (Brian McCane <bmccane@mccons.net>)
Список pgsql-admin
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;


В списке pgsql-admin по дате отправления:

Предыдущее
От: GB Clark
Дата:
Сообщение: Re: Sample database for me to practice with?
Следующее
От: "lonh SENG"
Дата:
Сообщение: Re: SQL Script