Results 1 to 1 of 1
  1. #1
    Join Date
    Nov 2004
    Posts
    6

    Unanswered: 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 12:32.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •