CREATE TABLE #Temporary
(
HoursThisYear int,
HoursLastYear int,
HoursBefore2010 int
)
INSERT
INTO #Temporary (HoursThisYear)
SELECT SUM(Hours) WHEN Year = '2011' FROM WorkFlow
我很陌生,不知道我在做什么。
答案 0 :(得分:1)
假设您正在寻找有关INSERT语法的帮助。
INSERT INTO #Temporary
(HoursThisYear)
SELECT SUM(Hours)
FROM WorkFlow
WHERE Year = '2011'
答案 1 :(得分:0)
CREATE TABLE #Temporary ( HoursThisYear int, HoursLastYear int, HoursBefore2010 int )
INSERT INTO #Temporary (HoursThisYear)
SELECT SUM(Hours)
FROM WorkFlow
WHERE Year = '2011'
答案 2 :(得分:0)
这应该有效
CREATE TABLE #Temporary
(
HoursThisYear int,
HoursLastYear int,
HoursBefore2010 int
)
INSERT
INTO #Temporary (HoursThisYear)
SELECT SUM(Hours)
FROM WorkFlow
WHERE Year = '2011'