MySQL updates a field in a table to be equal to the value of a field in another table

MySQL updates a field in a table to be equal to the value of a field in another table

As shown below:

update table1 as z left join table2 as zb on z.zcatId = zb.zcatId set z.zcatName = zb.zcatName where z.zcatName is null; 

The above MySQL update field in a table equal to the value of a field in another table is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • Sql query MySql database table name and description table field (column) information
  • How to get the field list after querying the results of the Python module pymysql
  • Summary of MySQL's commonly used SQL statements for creating tables, adding fields, modifying fields, and adding indexes
  • How to add fields to a large data table in MySQL
  • How to modify a MySQL table to add multiple columns (fields) and indexes at one time
  • MySql creates a table with explanation and annotates the table and fields
  • MySQL uses the select statement to query the data of the specified column (field) in the specified table
  • Mysql determines whether a table field or index exists
  • Delete a field in the MySQL table from the command line
  • Add a field to the table in the MySQL command line (field name, whether it is empty, default value)
  • Basic tutorial on using table aliases and field aliases in MySQL
  • How to use a field in one table to update a field in another table in MySQL

<<:  The JS hasOwnProperty() method detects whether a property is an object's own property.

>>:  Linux confirms that the data disk has been uninstalled and a new custom image can be created

Recommend

Linux virtual memory settings tutorial and practice

What is Virtual Memory? First, I will directly qu...

Vue3+el-table realizes row and column conversion

Table of contents Row-Column Conversion Analyze t...

Ubuntu16.04 builds php5.6 web server environment

Ubuntu 16.04 installs the PHP7.0 environment by d...

How to quickly modify the host attribute of a MySQL user

When you log in to MySQL remotely, the account yo...

Solve the problem of MySql client exiting in seconds (my.ini not found)

Problem description (environment: windows7, MySql...

Let's talk about the performance of MySQL's COUNT(*)

Preface Basically, programmers in the workplace u...

Top 10 useful and important open source tools in 2019

In Black Duck's 2017 open source survey, 77% ...

React encapsulates the global bullet box method

This article example shares the specific code of ...

Analysis of the implementation of MySQL statement locking

Abstract: Analysis of two MySQL SQL statement loc...

Detailed Example of CSS3 box-shadow Property

CSS3 -- Adding shadows (using box shadows) CSS3 -...

A brief analysis of MySQL's lru linked list

1. Briefly describe the traditional LRU linked li...

JavaScript to achieve JD.com flash sale effect

This article shares the specific code of JavaScri...

Develop calculator example code using native javascript

The main function of a calculator is to perform n...

The whole process of IDEA integrating docker to deploy springboot project

Table of contents 1. IDEA downloads the docker pl...