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
Code: <input type="text" class="...
This article example shares the specific code of ...
PHP related paths in Ubuntu environment PHP path ...
Background-image is probably one of those CSS pro...
I would like to share with you the graphic tutori...
Table of contents 1. Introduction 1.1 Principle 1...
1 method is a property that specifies how data is ...
Table of contents need Workaround 1. Set tooltip ...
What is CSS# CSS (abbreviation of Cascading Style...
Preface First, let's see how to identify a TC...
We all know that the commonly used positioning me...
This article shares the specific code of JQuery t...
Method 1: Use Google advanced search, for example...
Preface This article mainly introduces the releva...
Preface Recently, I encountered a requirement at ...