mysql - SQL group_CONCAT -


I'm using the World DB () I have to get the following column: City name - Population - Country name - List of languages ​​used in the country - Number of languages ​​used in country-continent

This is my query:

  SELECT city.NAME as city_name, city.Population, country.NAME, Group_concat (DISTINCT countrylanguage.language) AS language, calculation (different Native language.) Lang_nr, Country. INNER JOIN COUNTRY ON CITY CITY Country Code = country.Code INNER Please contact country country. City by country = CODE.CountryCode Group. Name by ORDER lang_nr DESC;  

But as a result, I get the number of different languages ​​for the same country. For future reference: I have solved it using subqueries

 

code> select city.name, (select country GROUP_CONCAT (Country Language) Country Country Language Country Country Language Country Language Country Country Code City City Country Language By Country Language Country Language (Select Country (*) Country Language from WHERE Country Language countrycode = city.countrycode GROUP By country language. Longitude on city lang_nr, city.population, country.name by city INNER JOIN countrycode = country.code ORDER by lang_nr DESC

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -