一起分組
在最後這個練習中,你會把 GROUP BY 和本章前面學過的彙總函式(例如 MIN)結合起來使用。
作為本章的結尾,我們會回到第 1 章用過的 eurovision 資料表。
本練習屬於課程
SQL Server 入門
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
-- Retrieve the minimum and maximum place, and point values
SELECT
-- the lower the value the higher the place, so MIN = the highest placing
MIN(place) AS hi_place,
___(place) AS lo_place,
-- Retrieve the minimum and maximum points values. This time MIN = the lowest points value
___(points) AS min_points,
MAX(points) AS max_points
FROM
eurovision;