group by 分组去重查询

数据库中的数据是这样的:

想要看看有几种类型,可以用group by:

  select * from activiti.act_ru_task 
 where PROC_INST_ID_ in (select PROC_INST_ID_ FROM activiti.act_ru_execution where BUSINESS_KEY_ in 
 (select  a.app_id from  bill_data.t_org_br_apply_info a left join user.t_user_info b on a.user_id=b.id where a.app_id in 
 (select b.app_id from bill_data.t_org_br_apply_person b  where 
b.tel_1 like '%15910383%' or
b.tel_1 like '%15910384%')))
 group by NAME_;

猜你喜欢

转载自www.cnblogs.com/jpr-ok/p/11955905.html