devxlogo

Updating Two Tables

Question:
I have two tables:

  • Yarn {Y_yarn_code,x_code}y_yarn_code being PK
  • Yarn_lot (yl_yarn_code)

I need to update yl_yarn_code with x_code where y_yarn-code=yl_yarn_code

Answer:
Try this:

 UPDATE Yarn_Lot SET Yarn_Lot.yl_yarn_code = (SELECT x_code    FROM Yarn   WHERE Yarn.y_yarn_code =    Yarn_Lot.yl_yarn_code)

Is this what you intended?

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  How Engineering Leaders Spot Weak Proposals

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.