34,837
社区成员




select
B.BranchId,
sum(case when N.status <> 99 and I.type = 1 then 1 else 0 end) pub_cnt,
sum(case when N.status = 1 and I.type = 1 then 1 else 0 end) confirmed_cnt
from
Branch B
left join News N
on B.BranchId = B.BranchId
left join Items I
on N.itemId = I.itemId
group by B.BranchId