groud by 多表关联

2017-08-31 08:42:01来源:cnblogs.com作者:Mask-male人点击

分享
select u.c_name,case when ur.c_role_id=73 then 'A类型' else 'B类型' end as roletype,case when u.c_online_status=1 then'在线' else '不在线' end as onlinestatus, t.* from(select ai.c_signed_user_id, count(1) as rcvEvtCount,sum(case when c_finished_date is  null then 1 else 0 end) as unPrcEvtCountfrom t_wf_activity_instance aigroup by ai.c_signed_user_id) as t join t_pmi_user u on u.c_id=t.c_signed_user_idjoin t_pmi_user_in_role ur on ur.c_user_id=u.c_idwhere ur.c_role_id in('73','74') and u.c_db_status=0

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台