0
CREATE TABLE #Temporary
(
HoursThisYear int,
HoursLastYear int,
HoursBefore2010 int
)

INSERT 
INTO #Temporary (HoursThisYear)
SELECT SUM(Hours) WHEN Year = '2011' FROM WorkFlow

我对此很陌生,不确定我在做什么。

4

3 回答 3

1

假设您正在寻找有关 INSERT 语法的帮助。

INSERT INTO #Temporary 
    (HoursThisYear)
    SELECT SUM(Hours) 
        FROM WorkFlow
        WHERE Year = '2011' 
于 2011-10-07T19:46:37.733 回答
0
CREATE TABLE #Temporary ( HoursThisYear int, HoursLastYear int, HoursBefore2010 int )

INSERT INTO #Temporary (HoursThisYear) 
    SELECT SUM(Hours) 
    FROM WorkFlow
    WHERE Year = '2011' 
于 2011-10-07T19:46:41.150 回答
0

这应该工作

CREATE TABLE #Temporary
(
HoursThisYear int,
HoursLastYear int,
HoursBefore2010 int
)

INSERT 
INTO #Temporary (HoursThisYear)
SELECT SUM(Hours) 
FROM WorkFlow
WHERE Year = '2011'
于 2011-10-07T19:47:00.613 回答