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
Table of contents 1. Example scenario 1.1. Set th...
1. Get the real path of the current script: #!/bi...
Unfortunately, the MYSQL_DATA_TRUNCATED error occ...
Since HTML email is not an independent HOST page o...
1. Upgrade process: sudo apt-get update Problems ...
The effect we need to achieve: What is needed The...
There are too many articles about xhtml+css websi...
Without further ado, these three methods are: ren...
<br />Related articles: Web skills: Multiple...
Today I will talk about a CSS special effect of h...
We often encounter this problem: how to use CSS t...
Table of contents 1. Introduction 2. RC and RR is...
Currently, most CPUs support floating-point units...
To install VMWare under Linux, you need to downlo...
When I was asked this question, I was ignorant an...