If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Update field in table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-31-05, 17:55
Themis Themis is offline
Registered User
 
Join Date: Nov 2004
Posts: 6
Update field in table

Hi everyone, I'm back..

Need the correct syntax to update a field in one table getting data from a field in another table.

Problem is the tables must be joined on two fields..

This is what I do:

begin work;

update bksyp
set ekptp=(select discount.discount from discount
where bksyp.isbne=discount.isbne and
bksyp.ypkod=discount.ypkod)

where
(bksyp.isbne in (select discount.isbne from discount) and
bksyp.ypkod in (select discount.ypkod from discount))
;

This updates more records than needed..
There must be something wrong in the last part I believe.

Thanx.

Last edited by Themis; 02-01-05 at 11:32.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On