Home » SQL & PL/SQL » SQL & PL/SQL » how to rewrite the beloe said query (Oracle 10G /Linux)
how to rewrite the beloe said query [message #394426] Fri, 27 March 2009 00:58 Go to next message
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 151 times)
Re: how to rewrite the beloe said query [message #394427 is a reply to message #394426] Fri, 27 March 2009 01:00 Go to previous messageGo to next message
BlackSwan
Messages: 25039
Registered: January 2009
Location: SoCal
Senior Member
Did you read & follow the bouncing RED ball advice as stated in URL below?
http://www.orafaq.com/forum/f/1/136107/
Did you read & follow Posting Guidelines as contained in URL below?
http://www.orafaq.com/forum/t/88153/0/
Re: how to rewrite the beloe said query [message #394439 is a reply to message #394426] Fri, 27 March 2009 01:58 Go to previous message
dhanamukesh
Messages: 51
Registered: January 2009
Member
Anyone would you please help me out to tune or rewrite the query....

Thanks
Dhanalakshmi.
Previous Topic: Writing file on Application server using its FTP
Next Topic: Wrong output from sql query
Goto Forum:
  


Current Time: Mon Dec 05 19:21:04 CST 2016

Total time taken to generate the page: 0.13916 seconds