这是我之前question的后续问题 我想将数据插入到表中,其中三列由select-join查询填充。这是我的sql语句::
INSERT INTO books ( gid, type, membernumber, changedate, order, user, task)
VALUES( '2b4493e8-cae8-4624-8177-fcc96553c5be',
2,
(SELECT member FROM mem m JOIN group g ON m.uid = g.sgroup),
TIMESTAMP '2017-01-03 00:00:00.000',
(SELECT order FROM orders o JOIN items i ON o.id = i.id),
'mark',
(SELECT task FROM tasks t JOIN lists l ON t.id = l.id),
);
我想要实现的是每个插入,成员编号,顺序和任务将根据它与各自的连接表的JOIN从mem,order和tasks表中获取。