Home » RDBMS Server » Server Administration » Problem In Deleting Records Using Two Tables
Problem In Deleting Records Using Two Tables [message #374909] Wed, 11 July 2001 07:17
N.Anandasiva
Messages: 7
Registered: July 2001
Junior Member
I want to delete selective records in a child table which has 38000 records. The condition is all these records must fall in the range of invoice date. The invoice date is stored in the Master file. I have not created any indexes. I used sub query. The problem is it takes more than seven min.

My query :

DELETE FROM BP_INVOICE_TRADE_DET a
WHERE a.Inv_Trade_No IN
(SELECT INV_TRADE_NO
FROM BP_INVOICE_TRADE_MAST
WHERE brn_code = a.brn_code and
comp_code = a.comp_code and
depot_code = a.depot_code and
division_code=a.division_code and
to_char(inv_trade_date,'YYYYMM')='200106);

I will be grateful if you can help me in fine tune this
query.

Regards
Anandasiva.
(Asst. Manager - Systems. Blow Plast Ltd, Mumbai, India)
Previous Topic: case when end
Next Topic: GROUP BY problem
Goto Forum:
  


Current Time: Wed Jul 03 02:36:47 CDT 2024