• Ok, from the sample data I assumed that the company is static, so that I removed the company from order by class, how ever when the change of the order class, your needed is fulfilled? Or what formats do need to retrieved?

    yes company is static. I put it in the ORDER BY for future maintenance.

    Im not sure what you meant by what formats need to be retrieved.