mysql通过any_value 函数查询非分组字段-group by
mysql 5.7 及其以上版本配合GROUP BY 关键字一起使用,查询非分组字段可以使用any_value 函数
select any_value(aht.ID_) as ID, any_value(aht.PROC_INST_ID_) as PROCESS_INSTANCE_ID, any_value(aht.START_TIME_) as CREATE_TIME, any_value(aht.END_TIME_) as END_TIME, any_value(ahp.BUSINESS_KEY_) as BUSINESS_KEY, any_value(ahp.START_USER_ID_) as START_USER, any_value(arp.NAME_) as PROCESS_DEFINITION_NAME from ACT_HI_TASKINST aht where aht.ASSIGNEE_ = #{username} group by aht.PROC_INST_ID_ order by END_TIME desc;