MySQL Updating a specific Field

Last update on June 9, 2009 09:55 AM by jak58
Published by jad05

MySQL Updating a specific Field








If you have two tables with a common key (in the case below it is the primary key "id"), it is possible to update a field in one of two tables (update_table) using data the second (reference_table) using a join.

The SQL code looks like this:

UPDATE update_table, reference_table SET update_table.field=reference_table.fieldref WHERE update_table.id=reference_table.id
Best answers for « MySQL Updating a specific Field » in :
Updating a table having a common key Show Updating a table having a common key In the case you have two tables with a common key (in the case below it is the primary key "id"), it is possible to update a field in one of two tables (update_table) using data the second...
Reinitializing the root password of MySQL ShowReinitializing the root password of MySQL The root password is lost! Reinitializing the password: It's important that you are able to access and modify the admin (root) password of MYSQL, either when installing MySQL for the first...
Unable to load dynamic library '/usr/lib/php4/20020429/mysql.so ShowUnable to load dynamic library '/usr/lib/php4/20020429/mysql.so You get a message like following following an update to PHP: Unable to load dynamic library '/usr/lib/php4/20020429/gd2.so' - /usr/lib/php4/20020429/gd2.so: cannot open...
MySQL - SELECT ... YESTERDAY ShowMySQL - SELECT ... YESTERDAY Make use of the following syntax: SELECT * FROM myTable WHERE field_date = DATE_SUB(CONCAT(CURDATE(), ' 00:00:00'), INTERVAL 1 DAY) In order to select previous records: SELECT * FROM myTable WHERE field_date =...
Download MySQL Essential ShowMySQL 5.4 Essential which is recommended for most users is one of the world’s most popular open source database. Includes a configuration wizard for optimal use. It is the most trustworthy, secure and up to date version of most database. To know...
Specifications ShowInterest of specifications "Specifications" refer to a contractual document describing what is expectd of the contractor by the client. It is a document that describes, as precisely as possible, in simple terms, the needs that the contractor must...
Webmastering - Maintaining and Updating a Website ShowMaintenance Plan the logistics Updating Checking the Links Hypertext links on websites often become obsolete. These links are called broken links. This risk of a link breaking is even greater when the link direct users to an outside site. It...