--测试环境
declare @t table(bookid int,type varchar(5))
insert into @t select 1,'''A'''
union all select 2,'''A'''
union all select 3,'''B'''
union all select 4,'''B'''
union all select 5,'''B'''
--查询SQL
select type,typeCount=count(type)
 from @T
group by type
--结果
type  typeCount   
----- ----------- 
'A'   2
'B'   3(所影响的行数为 2 行)