我有一个简单的问题。我有两张桌子FROM
和TO
. 我想将列Group
从复制FROM
到,TO
但只复制与id_number
. 它应该很简单,但我被卡住了。
insert into TO (Group)
SELECT Group
FROM FROM
WHERE FROM.id_number like TO.id_number
或者
INSERT INTO TO (Group)
SELECT Group
FROM FROM
WHERE id_number IN (SELECT id_number FROM TO)
这只是向表中添加了额外的列,它不会按照id_number
...更新行。
任何的想法?