34,874
社区成员
发帖
与我相关
我的任务
分享

select [对象], sum([未读数]) from
(
select receiver as [对象],1 as [未读数] from [聊天信息表] where sender='我的名称' and isread=0
union all
select sender as [对象],1 as [未读数] from [聊天信息表] where receiver='我的名称' and isread=0
) t group by [对象]