LEFT JOIN (select * from t_approval where id in (select MAX(id) from t_approval group by biz_id,biz_type)) t5 ON (t1.ID = t5.biz_id AND t5.biz_type=2)
LEFT JOIN (select * from t_approval where id in (select MAX(id) from t_approval where del_flag = 0 group by biz_id,biz_type)) t5 ON (t1.ID = t5.biz_id AND t5.biz_type=2)
LEFT JOIN t_trial_drive_shop t4 ON t1.created_by = t4.created_by
LEFT JOIN t_trial_drive_shop t4 ON t1.created_by = t4.created_by
LEFT JOIN t_user t6 ON t6.id = t1.created_by
LEFT JOIN t_user t6 ON t6.id = t1.created_by
left join t_electric_fence t7 on t4.fence_id=t7.id
left join t_electric_fence t7 on t4.fence_id=t7.id