• If the columns are dynamic then on what persistent basis do you plan to JOIN the columns??.....or is it that it does not matter??......Just by looking at your explanation it is not possible to assess the predicates of the JOIN you intend to do....please explain the requirement a little more.

    The explanation would be most effective if you can post and example scenario of what you are looking for with appropriate DDL, Sample Data and the Expected Result Set. Please have a look at the link in my signature to learn how to post DDL, Sample Data and the Expected Result Set.

    If you post Sample Data and DDL then people who read your post would get the exact picture of what you are trying to do and they would use the data you provide to find a solution for you and you would get a response instantly.

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉