I want to run the count(*) query to get result just 1 single row. getting unique distinct docindex_i count from the table, table has 431k row count in total, but there are multiple rows with same docindex_i , just want to see a unique total row count with distinct docindex_i.
how to use the below conditions. getting error.
select COUNT(*) from (select distinct docindex_i from [docudeck]);
create table dbo.docudeck(docindex_i int not null)
insert into docudeck
select 898989
union
select 898989
union
select 898989
union
select 898989
union
select 898989
union
select 898989
union
select 898989
union
select 898989
union
select 232
select COUNT(distinct docindex_i) from [docudeck] group by docindex_i
select COUNT(*) from (select distinct docindex_i from [docudeck] ) a group by docindex_i
drop table dbo.docudeck