Mulai sekarangMulai gratis

GROUP BY multiple fields

GROUP BY becomes more powerful when used across multiple fields or combined with ORDER BY and LIMIT.

Perhaps you're interested in learning about budget changes throughout the years in individual countries. You'll use grouping in this exercise to look at the maximum budget for each country in each year there is data available.

Latihan ini merupakan bagian dari kursus

Intermediate SQL

Lihat Kursus

Instruksi latihan

  • Select the release_year, country, and the maximum budget aliased as max_budget for each year and each country; sort your results by release_year and country.

Latihan interaktif langsung praktik

Cobalah latihan ini dengan melengkapi kode contoh ini.

-- Find the release_year, country, and max_budget, then group and order by release_year and country
___
Edit dan Jalankan Kode