【发布时间】:2021-03-01 12:17:32
【问题描述】:
我有一张桌子 A 看起来像:
id isin typ1 typ2
1 aa typA typB
2 bb typD typC
我需要插入一个如下所示的表 B:
id isin fld value
1 aa typ1 typA
2 aa typ2 typB
3 bb typ1 typD
4 bb typ2 typC
我可以使用 SQL 指令吗?
【问题讨论】:
-
插入 SELECT ... UNION ALL ...
-
你期望的结果是什么?
-
@Giovanni 。 . .用您正在使用的数据库标记您的问题。
标签: sql union sql-insert unpivot lateral-join