How do I do this update better ?

From: Steve <guitarzealot_at_yahoo.com>
Date: 12 Oct 2006 11:57:24 -0700
Message-ID: <1160679444.523333.29740_at_e3g2000cwe.googlegroups.com>



[Quoted] I want to join a table to itself to get rows that are related to each other and then
update row rev with values in row orig. It tried this update but is is doing a full
table scan. Are there better ways to do this?

Thanks

S

update modn.mn_sale rev

   set (rev.INV_QTY, rev.validation_status)

  • (select orig.inv_qty, orig.validation_status from modn.mn_sale orig where orig.reversal_status = 50 and rev.reversal_status = 30 and rev.BACKWARD_REF_ID = orig.SALE_ID and ABS(rev.INV_QTY) <> ABS(orig.INV_QTY))
Received on Thu Oct 12 2006 - 20:57:24 CEST

Original text of this message