declare @t table( c varchar(10));

insert @t
select *
from
(
 select 'A' as c union all
 select 'B' union all
 select 'B' union all
 select null union all
 select null
) t;

select count(*) from @t;
select count(c) from @t;
select count(distinct c) from @t;
select distinct c from @t;

测一下上面最后四条语句的执行结果: 

 

 

相关文章:

  • 2022-01-15
  • 2021-07-28
  • 2022-12-23
  • 2021-10-16
  • 2022-02-19
猜你喜欢
  • 2022-12-23
  • 2021-05-27
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
相关资源
相似解决方案