【发布时间】:2013-05-08 09:04:17
【问题描述】:
您好,我有一个临时表 (#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
我得到以下信息:列名或提供的值的数量与表定义不匹配。
【问题讨论】:
-
Check this post, 我想你也面临同样的问题
标签: tsql