sql group by sum

Solutions on MaxInterview for sql group by sum by the best coders in the world

showing results for - "sql group by sum"
Luigi
29 Oct 2018
1// Use SQL Group By clause after the Where clause
2// Any column in the select list must either be in the Group By clause 
3// or part of an agregation statement, like the Sum() statement
4// Multiple columns can be included in the Group By Clause seperated by a comma
5// Multiple columns stipulate the order tree. Order by 
6// first column, then second ... etc
7
8Select LastName, FirstName, Sum(LeaveDays), Max(age)
9From EmployeeProjects
10Where StartDate > '2020-01-01'
11Group By LastName, FirstName