I have no idea how to
group by by the column from subquery.
I want to group by
Here is my code:
select a.name, count(a.language) as count from (select temp2.name, countrylanguage.language from countrylanguage right join temp2 on temp2.code = countrylanguage.countrycode ) as a group by a.language;
I got a solution as below:
select temp2.name, count(countrylanguage.language) from countrylanguage join temp2 on temp2.code = countrylanguage.countrycode group by temp2.name;