查询结果集去重

关于查询结果集的去重
	在字段前面加上distinct
	mysql> select distinct job from emp;
	注:
		distinct只能出现在所有字段的最前面,表示所有字段联合去重
	1)统计岗位的数量
	mysql> select count(distinct job) from emp;

  

posted @ 2021-10-18 17:06  石乐智先生  阅读(121)  评论(0编辑  收藏  举报