您好我有一個臨時表(#temptable1),我想從另一個臨時表中添加一列(#temptable2)成,我的查詢如下:牛逼SQL SELECT到現有表新列
select
Customer
,CustName
,KeyAccountGroups
,sum(Weeksales) as Weeksales
into #temptable1
group by Customer
,CustName
,KeyAccountGroups
select
SUM(QtyInvoiced) as MonthTot
,Customer
into #temptalbe2
from SalesSum
where InvoiceDate between @dtMonthStart and @dtMonthEnd
group by Customer
INSERT INTO #temptable1
SELECT MonthTot FROM #temptable2
where #temptable1.Customer = #temptable2.Customer
我收到以下內容:列名或提供的值數量與表定義不匹配。
[檢查這個帖子,](http://stackoverflow.com/questions/1152932/column-name-or-number-of-supplied-values-does-not-match-table-definition) 我認爲你面臨同樣的問題 – gefrag 2013-05-08 09:08:24