表1 MBM_CASE
表2 MOS_ORGANIZATION
统计主体表:表1,其中字段P_JUSTICE_BUREAU存储的为 表2 的type_id = '255afee102374b60b770de3b601f0f0b'类型的id,需翻译成name
select aP_JUSTICE_BUREAU,bP_JUSTICE_BUREAU_NAMER,count() as total from MBM_CASE as a
left join (select id,p_name as P_JUSTICE_BUREAU_NAMER from MOS_ORGANIZATION as b where type_id = '255afee102374b60b770de3b601f0f0b') as b on aP_JUSTICE_BUREAU = bid
where aP_STATUS = 'VALID' AND aP_CASE_STATUS != 'DRAFT' AND aP_ACCEPTANCE_DATE BETWEEN '2017-01-01' AND '2017-12-31'
GROUP BY aP_JUSTICE_BUREAU,bP_JUSTICE_BUREAU_NAMER
以上就是关于达梦数据库left join + group查询全部的内容,包括:达梦数据库left join + group查询、、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)