My suggestion would be to group by instructor but I might not fully understand your problem.
select course.courseid, courseinstruc.instructor, sum(tempcourse.stdcount) as stdtotal;
from course left join courseinstruc on course.courseid = courseinstruc.courseid,;
tempcourse;
where course.courseid = tempcourse.courseid;
into cursor temporary
group by courseinstruc.instructor
Rip Ryness
International Falls, MN