dbTalk Databases Forums  

Update statement help!

comp.databases.paradox comp.databases.paradox


Discuss Update statement help! in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Larry DiGiovanni
 
Posts: n/a

Default Re: Update statement help! - 02-02-2006 , 02:07 PM






Chi Pheo wrote:

Quote:
update "table1.db"
set "table1.db".id = "table2.db".id
where ("table1.db".code = "table2.db".code)

Try:

update table1 t1
set t1.id = (select t2.id
from table2 t2
where t1.code = t2.code)


--
Larry DiGiovanni
Digico, Inc.
IT Consulting and Staffing Solutions
www.digicoinc.com
Check out www.thedbcommunity.com for Paradox resources.




Reply With Quote
  #2  
Old   
Chi Pheo
 
Posts: n/a

Default Update statement help! - 02-03-2006 , 12:36 AM






Hello!
I have 2 tables: table1.db (id, code, name) and table2.db (id, code, name)
with the same structures.
Due to some reasons I must update tables: set table2.id = table1.id where
table2.code = table1.code
I tried to do like this:

update "table1.db"
set "table1.db".id = "table2.db".id
where ("table1.db".code = "table2.db".code)

But It does not work.
Pls help me.
Thanks in advance!



Reply With Quote
  #3  
Old   
Chi Pheo
 
Posts: n/a

Default Re: Update statement help! - 02-03-2006 , 01:43 AM



Wow, thank you so much!
It works well.



"Larry DiGiovanni" <nospam (AT) nospam (DOT) com> wrote

Quote:
Chi Pheo wrote:

update "table1.db"
set "table1.db".id = "table2.db".id
where ("table1.db".code = "table2.db".code)


Try:

update table1 t1
set t1.id = (select t2.id
from table2 t2
where t1.code = t2.code)


--
Larry DiGiovanni
Digico, Inc.
IT Consulting and Staffing Solutions
www.digicoinc.com
Check out www.thedbcommunity.com for Paradox resources.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.