mysql去重查询表中数据

拥有回忆 提交于 2019-12-04 21:27:25

1、distinct

select count(distinct CName) from teble
select count(CName) from (select distinct CName from Course) as temp
SELECT  DISTINCT text_zhcn FROM dms_menuconfig  -- 去重查询表中数据
select DISTINCT(user_id) from user_info where children_merchant_id='kuaiditong';

 

2、group by

select count(1) from Course group by CName

 

文档:mysql去重查询表中数据.note
链接:http://note.youdao.com/noteshare?id=581440d92396bab4de6568d1a69baa58&sub=9B8DAB091CC5490BA5F8FA29557CCD67

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!