Horje Website
SQL Group By Clause – MYsql Code

SQL Group By Clause

SQL Group By Clause - SQL Code


 
  1. SELECT t1.dept_name, count(t2.emp_id) AS total_employees
  2. FROM departments AS t1 LEFT JOIN employees AS t2
  3. ON t1.dept_id = t2.dept_id
  4. GROUP BY t1.dept_name;



Try Your Self ->



Published:
September 28, 2020
Author:
admin
Category:
SQL Advanced, SQL Source Code
Views:
21

This article was posted in SQL Advanced, SQL Source Code and tagged , , . Bookmark the permalink. Follow comments with the RSS feed for this post.Post a Comment or leave a trackback: Trackback URL.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Horje © 2011 - 2023