こんにちは、一時テーブル (#temptable1) があり、別の一時テーブル (#temptable2) から列を追加したいのですが、クエリは次のとおりです。
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
次のように表示されます: 列名または指定された値の数がテーブル定義と一致しません。