我有这张 F_Flight 表,我试图从 3 个不同的表中插入它。第一列、第四列和第五列来自同一个表,第二列和第三列来自不同的表。执行代码时,出现“单行子查询返回多行”错误。
insert when 1 = 1 then into F_Flight (planeid, groupid, dateid, flightduration, kmsflown) values
(planeid, (select b.groupid from BridgeTable b where exists (select p.p1id from pilotkeylookup p where b.pilotid = p.p1id)),
(select dd.id from D_Date dd where exists (select p.launchtime from PilotKeyLookup p where dd."Date" = p.launchtime)),
flightduration, kmsflown) select * from PilotKeyLookup p;