Tuesday, May 5, 2020

Answer for Group By with count

https://365datascience.com/dwqa-answer/answer-for-group-by-with-count/ -

Hi Alan!

Thanks for reaching out.

If I’ve managed to understand you correctly, you are referring to the following query, right?


SELECT 
first_name, COUNT(first_name)
FROM
employees
GROUP BY first_name;

If yes, then the output is not sorted in alphabetical order only because you have not added an ORDER BY clause in the following way.


SELECT 
first_name, COUNT(first_name)
FROM
employees
GROUP BY first_name
ORDER BY first_name;

Hope this helps.
Best,
Martin




#365datascience #DataScience #data #science #365datascience #BigData #tutorial #infographic #career #salary #education #howto #scientist #engineer #course #engineer #MachineLearning #machine #learning #certificate #udemy

No comments:

Post a Comment