• The "easiest to understand" type of solution is to build a temp table exactly like you want the output to look. Then have individual queries gather the pieces of information and update the temp table as you go along. All of these queries can be wrapped as one in a stored procedure. It's not hard, you just have to break it down into manageable chunks. What have you tried so far?

    ______________________________________________________________________________
    How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.