Results 1 to 3 of 3

Thread: Update function

  1. #1
    Join Date
    Sep 2014

    Post Unanswered: Update function

    i am trying to write a function to update my MYSQL Database.

    The database has two products tables products1 and products2.
    In the products1 and products2 is the feilds item_code and width.
    Item code is the unique reference in both the tables.
    in products1 is over 3000 entries and in products2 is around 1000.
    in the products2 is the updated version of 1000 entries of products1.

    i am trying to get so that it update's product1 by identify the Unique values and putting in the width value if the item_code matches.
    so far i have been looking thisup and got this far i have not tryed this as of yet so do not know if this is correct but am now getting stuck:
    update products1
    set item_code = products2.item_code,
    width = products1,
    width = products2
    from products1, products2
    where products1.item_code = products2.item_code

    Can anyone please help/explain this

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    update products1
    set products1.width = products2.width
    where products1.item_code = products2.item_code
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Sep 2014
    perfect thankyou very much!

Posting Permissions

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