sql统计不重复条数

2025年03月23日 20:35
有1个网友回答
网友(1):

select count(*)
from
(
select 字段
from 表
group by 字段
having count(字段)<=1
order by 字段
)
结果应该和
select count(1) from(select distinct 字段 from 表)一样
这种方法才是对的