Combine MySQL Update and LEFT JOIN to make it dynamic

Here is how you can combine a MySQL UPDATE with LEFT JOIN to make the query more dynamic.

<?php
UPDATE
`x_client_import` LEFT JOIN term_node
USING
( nid )
LEFT JOIN node ON ( node.title LIKE `x_client_import`.`client`
AND `
node`.`status` =1 ) SET `x_client_import`.`nid`=`node`.`nid` WHERE `term_node`.`tid`
IN ( 329 );
?>


or

<?php
UPDATE
`content_type_client` LEFT JOIN `x_client_import` USING (nid) SET `content_type_client`.`field_c_ongoing_value` = `x_client_import`.`ongoing_value` WHERE `content_type_client`.`field_c_ongoing_value` IS NULL;
?>



or
<?php
UPDATE
`sgab`.`old_glalsname` AS orig LEFT JOIN `sgab`.`old_glalsname` AS tmp ON tmp.ixCCGLCode = 'SE-SPI-VÄ' SET orig.grpGLCodes = tmp.`GLCode` WHERE orig.`ixCCGLCode` = 'SE-SPI-KM0';
?>
Knowledge keywords: