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

WeChat applet calculator example

This article shares the specific code of the WeCh...

Detailed explanation of the processing of the three Docker Nginx Logs

Because colleagues in the company need Nginx log ...

Summary of Linux Logical Volume Management (LVM) usage

Managing disk space is an important daily task fo...

Node uses koa2 to implement a simple JWT authentication method

Introduction to JWT What is JWT The full name is ...

Ten Experiences in Presenting Chinese Web Content

<br /> Focusing on the three aspects of text...

Introduction to network drivers for Linux devices

Wired network: Ethernet Wireless network: 4G, wif...

Windows Server 2019 Install (Graphical Tutorial)

Windows Server 2019 is the latest server operatin...

A brief discussion on the role and working principle of key in Vue3

What is the function of this key attribute? Let’s...

How to make React components full screen

introduce This article is based on React + antd t...