Group by Clause
Group by clause is used to group a data on a basis of
specified columns.
- Group by function is used with aggregate functions like SUM , Count , Max , Min
Group by <Column names>
SELECT DeptID , DeptName, max(salary) as Salary FROM Salary
where salary > 20000
group BY DeptID , DeptName
Above query will return Maximum salary of those departments where
salary is greater than 20,000
No comments:
Post a Comment