From: Lonh SENG <slonh@camgsm.com.kh>
To: pgsql-sql@postgresql.org
Subject: Coalesce Get Duplicate Record
Date: Thu, 7 Mar 2002 16:30:03 +0700
Message-ID: <003801c1c5ba$b06543e0$05a00017@idlonh> (raw)
Hi all,
I have got the idea of using coalesce from admin list.
It's cool.
For this moment, I want to know something more you.
Why I have got duplication record as shown in the result.txt attached file?
The other on is the script I used. Of course, I need some help from you urgently.
Your comment will be gratefully appreciated.
Thanks in advance
Best Regards,
Lonh SENG
Attachments:result.txt (text/plain, 711B) download
f1 f2 f2 f3 f4 ENDING_BAL COST ENDING_BAL1 COST1 INFO INFO1
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
a b 2002-03-05 06:11:42.000 2002-03-05 07:38:21.000 14 8.3000 .2000 8.1000 .0000 OUTGOING OUTGOING
a b 2002-03-05 06:11:42.000 2002-03-05 07:38:21.000 14 8.3000 .2000 NULL NULL OUTGOING NULL
script.txt (text/plain, 321B) download
insert into Rin_cdr_call_cleaned (f1 , f2 , f3 , f4 , ENDING_BAL , COST,INFO,inbtime1)
select
t1.card,t1.phone, t1.inbtime,length,ending_bal, cost,info, coalesce((select min(inbtime)
from
rin_cdr_call_history t2
where
t2.inbtime>t1.inbtime
and
t2.card=t1.card), t1.inbtime)
from
rin_cdr_call_history t1
order by
1,2
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: slonh@camgsm.com.kh
Subject: Re: Coalesce Get Duplicate Record
In-Reply-To: <003801c1c5ba$b06543e0$05a00017@idlonh>
* 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