Heim >Datenbank >MySQL-Tutorial >mysql 跨表查询、更新、删除示例_MySQL

mysql 跨表查询、更新、删除示例_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:18:291066Durchsuche

bitsCN.com 下面来谈谈跨表插入,更新和删除

首先讨论的是跨表查询:

insert into `table_A` select * from `table_B`;注意*代表全部插入。

接着又讨论关于跨表更新

update `table_A`, `table_B` set `table_A`.`name` = `table_B`.`name` where `table_A`.`id` = `table_B`.`id`;
bitsCN.com

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn