I am using SQL Server to write a simple select query that should fetch all records on same row, instead of multiple rows. For example:
The data is:
ID PlanName Year
1001 AP_Q1 2006
1001 AP_Q2 2006
1001 AP_Q3 2006
1001 AP_Q4 2006
And I want this out put:
ID PlanName1 PlanName2 PlanName3 PlanName4 PlanYear
1001 AP_Q1 AP_Q2 AP_Q3 AP_Q4 2006
How can this be achived with SELECT statement?
Thanks in adavnce for any ideas.
The data is:
ID PlanName Year
1001 AP_Q1 2006
1001 AP_Q2 2006
1001 AP_Q3 2006
1001 AP_Q4 2006
And I want this out put:
ID PlanName1 PlanName2 PlanName3 PlanName4 PlanYear
1001 AP_Q1 AP_Q2 AP_Q3 AP_Q4 2006
How can this be achived with SELECT statement?
Thanks in adavnce for any ideas.