select 前四个字段名,min(starttime),max(endtime) from table group by 前四个字段名
select flowtitle,applyid,instanceid,flowid,min(starttime),max(endtime) from 你的表 group by instanceid