1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

How to select parent item and child with highest count using SQL

Discussão em 'Outras Linguagens' iniciado por Stack, Maio 28, 2021.

  1. Stack

    Stack Membro Participativo

    [​IMG]

    So this is my database and this is my code for now

    select distinct continentname, countryname, max(numberoflanguages)
    from continent
    inner join country on continent.continent = country.continent
    group by continentname, countryname
    order by continentname


    It still shows every single continent but I need the top 1 country in every single continent who have the most numberoflanguages.

    Kind of like this as output

    [​IMG]

    Please correct me.

    Continue reading...

Compartilhe esta Página