We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Hi the reason we have used the founders name in the groupby clause is because if you see the select statement then you see that we have performed aggregate function of COUNT on 4 things and 2 which are the company code and the founder name do not have any aggregate function. so we know according to rules of groupby that either it has to have an aggregate function or it must be included in the GROUP by clause and hence we used the company code and the founder name in the GROUP BY clause.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
New Companies
You are viewing a single comment's thread. Return to all comments →
Hi the reason we have used the founders name in the groupby clause is because if you see the select statement then you see that we have performed aggregate function of COUNT on 4 things and 2 which are the company code and the founder name do not have any aggregate function. so we know according to rules of groupby that either it has to have an aggregate function or it must be included in the GROUP by clause and hence we used the company code and the founder name in the GROUP BY clause.