问个简单的sql查询,怎么查数据库中不重复的列值

如题所述

如果得到所有值不重复。
select cc from tablename group by cc

select distinct cc form tablename
如果得到没有重复的所有制,
select cc from tablename group by cc
minus
select cc
from(
select cc,count(*) from tablename group by cc having count(*)>1) A
温馨提示:答案为网友推荐,仅供参考
第1个回答  2017-01-03
select distinct
相似回答