Skip to content
Advertisement

Stuck on final SQL query

I’m busy creating a report and am stuck with how to structure the final query. I have a sub-query that returns the following result set

Sub-query Result

I need the final query result to look like this:

enter image description here

I know I can get there with an over engineered query, but would rather do it the right way, while also learning something new. Would really appreciate any help or suggestions. Thanks

PS Using Microsoft SQL Server 2014

Advertisement

Answer

Here is a sample of code that should do what you are expecting it to do.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement