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

Font Treasure House 50 exquisite free English font resources Part 1

Designers have their own font library, which allo...

Docker executes a command in a container outside the container

Sometimes we want to execute a command in a conta...

Practical method of upgrading PHP to 5.6 in Linux

1: Check the PHP version after entering the termi...

Website front-end performance optimization: JavaScript and CSS

I have read an article written by the Yahoo team ...

Vue implements two-way data binding

This article example shares the specific code of ...

Analysis of the solution to Nginx Session sharing problem

This article mainly introduces the solution to th...

Nginx access log and error log parameter description

illustrate: There are two main types of nginx log...

What to do if you forget your mysql password

Forgot your MySQL password twice? At first I did ...

MySQL 8.0.12 Installation and Usage Tutorial

Recorded the installation and use tutorial of MyS...

Detailed tutorial on deploying Springboot or Nginx using Kubernetes

1 Introduction After "Maven deploys Springbo...

How to Fix File System Errors in Linux Using ‘fsck’

Preface The file system is responsible for organi...

A brief discussion on the binary family of JS

Table of contents Overview Blob Blob in Action Bl...

How to install docker using YUM

As shown in the following figure: If the version ...