题解 | #查询结果去重#

查询结果去重

https://www.nowcoder.com/practice/82ebd89f12cf48efba0fecb392e193dd

/*使用distinct*/
select distinct(university)
from user_profile

/*使用group by*/
select university
from user_profile
group by university

sql去重的方法通常用两种,一种是使用distinct,另外一个是group by实现,

下面是distinct与group by的区别,和使用场景

https://juejin.cn/post/6979045255224131621?searchId=20230725173540FF553B4C5B990F0FA0AB

全部评论

相关推荐

刘湘_passion:太强了牛肉哥有被激励到
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务