Can you please explain more about your requirement as I could not understand the resultset you want ?
Can you please post your query, you have tried so far. may be that can help us to understand where are you coming from and what exactly you need ?
--rhythmk
------------------------------------------------------------------
To post your question use below link
https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help
🙂