I created in mariadb a table “countrystatistic” with a CountryName varchar(50), PrimaryLanguage varchar(50) and population int(11). I then insert it several countries.
I’m trying to write a query that would print the countries that share the same primary language. Somehow it’s not working out completely. I have this query but this one doesn’t print ALL the coutries with the common language.
SELECT ALL PrimaryLanguage,COUNT(Primarylanguage),CountryName
GROUP BY PrimaryLanguage
HAVING COUNT(PrimaryLanguage) > 1;
I tried using a lot of queries with Join. I either got only part of the answer or an error this gave me an error:
SELECT DISTINCT A.PrimaryLanguage, A.CountryName, B.CountryName
From countrystatistic A, countrystatistic B
Where A.PrimaryLanguage = B.PrimaryLanguage
AND A.count(PrimaryLanguage) > 1;
Can someone help me with this? Thank you!