原始数据
--使用子查询
SELECT * FROM student s WHERE s.birthday IN (SELECT MIN(s2.birthday) FROM student s2 GROUP BY s2.major)
--使用row_number()函数
SELECT * FROM (SELECT s.*, row_number() OVER(PARTITION BY s.major ORDER BY s.birthday) hh FROM student s) r WHERE r.hh='' --效率稍快