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.
我试图找到将 UNPIVOT 语句的结果插入数据库中现有表的语法?
适用于包括 UNPIVOT 在内的任何 SELECT 的最简单答案是......
INSERT INTO MyTable SELECT statement
但是,这确实要求您的目标表列与您的 SELECT 语句列匹配。
尽管您可以通过以下方式解决此限制...
INSERT INTO MyTable (column1, column2....) SELECT statement