1. Modify 1 column update student s, city c set s.city_name = c.name where s.city_code = c.code; 2. Modify multiple columns update a, b set a.title=b.title, a.name=b.name where a.id=b.id • Subqueries update student s set city_name = (select name from city where code = s.city_code); Oracle query reports this error: The database has multiple duplicate data according to your query conditions. For example: UPDATE "SYS_ROLE" A SET A ."DEPT_ID" = ( SELECT c."id" FROM "his_department_info" c WHERE c."dept_name" = A ."ROLE_NAME" If the above SQL statement reports the error "single-row subquery returns more than one row", it means that the data of the two fields "dept_name" in table C and "ROLE_NAME" in table A are repeated. Summarize The above is what I introduced to you on how to use the fields in one table in MySQL to update the fields in another table. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Example of implementing the Graphql interface in Vue
>>: Detailed steps for Python script self-start and scheduled start under Linux
MySQL allows you to create multiple indexes on a ...
Table of contents 1. Uninstall the original drive...
There are two ways to expose container ports in d...
Table of contents 1. Install the psutil package S...
1. Introduction to MMM: MMM stands for Multi-Mast...
Preface MySQL is a relational database with stron...
Recently, several data anomalies have occurred in...
mysql 5.7.21 winx64 installation and configuratio...
This article shares the specific code for the WeC...
This article example shares the specific code of ...
Table of contents Hidden Problems Solution to ada...
<br />This is from the content of Web front-...
Written in advance: In the following steps, you n...
This article shares the specific code of JS to ac...
Input subsystem framework The linux input subsyst...