Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何根据两个表上的简单连接条件的结果将值插入到列中?
我已经设法为 UPDATE 执行此操作,但不是 INSERT,因为所有值都以逗号分隔在一起。
with expr(a,b) as ( select t.val, u.val from (values(0,1)) as t(id,val) join (values(0,2)) as u(id,val) on t.id = u.id ) insert into table(column) select a as vals from expr union all select b from expr