CREATE TABLE #Temporary
(
HoursThisYear int,
HoursLastYear int,
HoursBefore2010 int
)
INSERT
INTO #Temporary (HoursThisYear)
SELECT SUM(Hours) WHEN Year = '2011' FROM WorkFlow
我对此很陌生,不确定我在做什么。
CREATE TABLE #Temporary
(
HoursThisYear int,
HoursLastYear int,
HoursBefore2010 int
)
INSERT
INTO #Temporary (HoursThisYear)
SELECT SUM(Hours) WHEN Year = '2011' FROM WorkFlow
我对此很陌生,不确定我在做什么。
假设您正在寻找有关 INSERT 语法的帮助。
INSERT INTO #Temporary
(HoursThisYear)
SELECT SUM(Hours)
FROM WorkFlow
WHERE Year = '2011'
CREATE TABLE #Temporary ( HoursThisYear int, HoursLastYear int, HoursBefore2010 int )
INSERT INTO #Temporary (HoursThisYear)
SELECT SUM(Hours)
FROM WorkFlow
WHERE Year = '2011'
这应该工作
CREATE TABLE #Temporary
(
HoursThisYear int,
HoursLastYear int,
HoursBefore2010 int
)
INSERT
INTO #Temporary (HoursThisYear)
SELECT SUM(Hours)
FROM WorkFlow
WHERE Year = '2011'