当前位置:网站首页>SQL where multiple field filtering

SQL where multiple field filtering

2022-07-07 04:23:00 Data analysis of financial Xiaobai

SELECT device_id,university,gpa FROM user_profile WHERE (university,gpa) 
IN (SELECT university,MIN(gpa) FROM user_profile GROUP BY university) ORDER BY university
#  Use window functions  ROW OVER() (PARITITION BY " Press that field " ORDER BY " What sort " )
SELECT device_id,university,gpa FROM (SELECT device_id,university,gpa,(RANK() over (PARTITION BY university ORDER BY gpa )) as m  FROM user_profile) AS A   WHERE  A.m=1
原网站

版权声明
本文为[Data analysis of financial Xiaobai]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130802179381.html