题解 | 查询结果去重

查询结果去重

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

select distinct university from user_profile;
select university from user_profile group by university;

二种方式去重:

1、distinct 关键词

2、group by 分组

1.distinct 关键字select distinct university from user_profiledistinct去重,放在列的前面使用。

2.分组SELECT university from user_profile group by university以分组来筛选出去重的结果

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务