SELECT service_contents.*, join_expertise.*, staff.* FROM service_contents INNER JOIN join_expertise ON service_contents.ServicesID = join_expertise.RowsExpertiseContentID INNER JOIN staff ON join_expertise.RowsStaffContentID = staff.StaffID WHERE service_contents.ServicesID = ? GROUP BY StaffID ORDER BY IF(Locate('Head of Family Children',StaffJob)<>0,1,0), StaffOrder ASC