I have an example which has come from at least two PCs' ago (so that the real 
file date has long gone) that I think came originally from Dennis or Bill:
update Table2 set Id2 = T1.Id2 from Table1 T1, Table2 T2 where T1.Id1 = T2.Id1

Regards - and thanks again to whoever it was,
Alastair.


  From: jan johansen 
  Sent: Tuesday, May 18, 2010 7:35 PM
  To: RBASE-L Mailing List 
  Subject: [RBASE-L] - Updating speed


  Group,

  I recently had a case where I needed to evaluate my need to use cursors.
  So I thought I would examine the help document on speeding up.

  Frequently I need to update columns in one table based on values in another.
  The really fast way to accomplish this is using something like this.

  UPDATE table1 SET +
    column1 = column1, +
    column2 = column2, +
    column3 = column3 +
   FROM table2,table1 +
   WHERE table1.commoncolumn = table2.commoncolumn

  Sometimes we need a little push so I would encourage to explore other ways
  of doing things.

  Jan  



------------------------------------------------------------------------------



  No virus found in this incoming message.
  Checked by AVG - www.avg.com 
  Version: 9.0.819 / Virus Database: 271.1.1/2881 - Release Date: 05/18/10 
07:26:00

Reply via email to