Group similar data and show it is column wise

  • Hi all,

    i have a table in the following way

    id Column1 Column2

    1 RAJ INDIA

    2 RAJ U.S.A

    3 RAJ U.K

    4 JOHN EUROPE

    5 JOHN U.S.A

    now i want the result set in the following way

    1 RAJ INDIA U.S.A U.K

    2 JOHN EUROPE U.S.A

    i am not speaking about the ui...when i run my query i want it this way in sql resultset

    can anyone please help me in achieving this.

    need help..

  • How dynamic does it need to be? Is there a pre-determined limit to the number of columns the result set can return, or do you need this to dynamically add columns to the result set?

    There are several ways to pivot data. Search this site a bit for some articles. Jeff posted something recently that was pretty good in describing the performance differences.

    Typically, you are much better off pivoting data at the client - especially if the number of columns needs to be dynamic.

  • yes my column should be dynamic..

    the number may increase later..

    please help..

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply