【发布时间】:2015-12-19 09:40:22
【问题描述】:
我想将 table1.id 插入到 table2.t1col 中,前提是 table1.id 尚不存在于 table2.t1col 中。
我想我必须使用:
insert into table2 name (t1col) value (select id from table1)
但我只想在id 已在table2 中不存在的情况下添加。
【问题讨论】:
标签: sql postgresql sql-insert upsert