From cd97c45a6498eed5822d09efc7833d93f0f9a81e Mon Sep 17 00:00:00 2001 From: Mo Binni Date: Thu, 15 Oct 2020 11:23:17 -0400 Subject: [PATCH] Update answers.sql --- SQL Deep Dive/Group By/answers.sql | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/SQL Deep Dive/Group By/answers.sql b/SQL Deep Dive/Group By/answers.sql index 62bb693..c12fdde 100644 --- a/SQL Deep Dive/Group By/answers.sql +++ b/SQL Deep Dive/Group By/answers.sql @@ -4,10 +4,9 @@ * Table: Employees */ -SELECT a.hire_date, COUNT(b.hire_date) as "amount" -FROM employees as a, employees as b -WHERE a.hire_date = b.hire_date -GROUP BY a.hire_date +SELECT hire_date, COUNT(hire_date) as "amount" +FROM employees +GROUP BY hire_date ORDER BY "amount" DESC; /*