57,062
社区成员
发帖
与我相关
我的任务
分享
declare @a table(id int,city_id int,title varchar(10))
insert into @a
select 1,1,'xx' union all
select 2,2,'xxx' union all
select 3,3,'xxxx' union all
select 4,1,'xxx' union all
select 5,2,'xxxx' union all
select 6,2,'xxxx'
select * from @a
select distinct city_id,count(title) as [count(title)] from @a group by city_id;