how to rewrite the beloe said query [message #394426] |
Fri, 27 March 2009 00:58  |
dhanamukesh
Messages: 51 Registered: January 2009
|
Member |
|
|
This query is to remove duplicates from the table cnsmr_notf_msg. For the same value of tran_ref_id and snd_tran_Date , if there are multiple cnmsr_ids, then we will keep the record with min(consumer.create_date) and delete the rest.
Example. In table cnsmr_notf_msg, if we have following duplicate data,
cnsmr_id tran_ref_id snd_tran_Date
123 1 1/1/09
456 1 1/1/09
789 1 1/1/09
Consumer table:
cnsmr_id create_Date
123 1/15/09
456 1/15/08
789 1/15/07
Then we will delete cnsmr_ids 123 and 456 as cnsmr_id 789 has the minimum create date.
I have attached query with this.
Regards,
Dhanalakshmi.
-
Attachment: TPCR651O.sql
(Size: 6.33KB, Downloaded 759 times)
|
|
|
|
|