SELECT
    device_id,
    university,
    round(gpa, 4)
FROM
    (
        select
            device_id,
            university,
            gpa,
            dense_rank() over (
                PARTITION BY
                    university
                ORDER BY
                    gpa
            ) rk           #排名
        from
            user_profile
    ) a
where
    a.rk = 1;