SQL GROUP BY with JOIN clause

Submitted by:Jhon Jhon

Date added:18 January, 2012


You can combine with SQL JOIN clause to show department name with count.

Tags: join clause , group by

Code Snippet:

SELECT D.name as Department,
count(employee_id) as Employee Count
FROM employees_table AS E
INNER JOIN Departments AS D
ON D.department_id = E.department_id
GROUP BY department_name