Yup.. SQL JOINs, then use ASP to mark a change in records. If the company changes, code it to display the new company name... if the department changes, code it to display the department name, etc, etc, etc...
So logically, each record returned from your SQL will have a company, department, employee, and salary. Each iteration of the loop you should be looking at the current record values, and the previous record values (which you can store in variables, overwritten each iteration), then determining what has changed, and outputting the text appropriately.