Я новичок в SQL.
Запрос:
SELECT
E.name AS Employee_Name,
P.HoursWorked AS Hours_Worked,
DATENAME(month, C.dayid) AS Month_Name
FROM employee E
INNER JOIN employeepaysummary P ON E.employeeId = P.employeeId
INNER JOIN CalendarDay C ON P.dayid = C.dayid ;
возвращает результат ниже:
Employee_Name Hours_Worked Month_Name
John, Sturgis 6 January
John, Sturgis 8 January
John, Sturgis 8 January
Sheldon, Cooper 7 January
Sheldon, Cooper 6 January
Как можно суммировать (часы_работал) столбец?