【发布时间】:2011-11-21 15:27:08
【问题描述】:
我有一个批量插入查询
insert into table1(shift) select value from table2 where transid='shiftid'
此查询将 table2 中的所有移位值插入到我的 table1 移位列中。
但是如果我想在 table1 的多列中插入记录,但我的选择查询将只返回一列,比如:
select value from table1 where transid in ('shiftid','gradeid','currencyid')
它将返回包含所有值的一列。但我想插入:
insert into table1(shift,grade,currency) ...........
任何人都可以为我填写....吗?希望你能理解我的要求。
【问题讨论】:
-
我怀疑您混淆了
column和row(除其他外)这两个术语。您应该在问题中包含两个表的表定义。
标签: sql postgresql