【发布时间】:2015-05-17 20:41:21
【问题描述】:
我有两个几乎相同的数据库表,其中列和行数相同。
它们每行都有一个唯一的 ID,这在两个表中是相同的。
第一个表在某些列上缺少某些值。 如何将 table2 中的行中的值复制到 table1 中的行? 这些列具有相同的名称,但 table1 中的值为空,而 table2 中的值为空。我想将 table2 中某些列的所有值复制到 table1 中的相同列。
这是一张超过 100 万行的大表。
例子:
Table 1 Row 5:
id = 5
orgnr = 932942
homepage = NULL
name = NULL
Table 2 Row 5:
id = 5
orgnr = 932942
homepage = 'www.domain.com'
name = 'John Smith'
我想将主页和名称中的值复制到 table1 的列中。
提前致谢。
【问题讨论】:
标签: mysql