Hi,
i have a following table. I want to display some column as rows. Please help me achieving this.
Here is the sample table
EmployeeTable
---------------
EmpID 2008Scores 2009Scores 2010Scores
2 12 14 18
select EmpID , [Year], 2008Scores ScoreValue
from Table1
union all
select EmpID , [Year], 2009Scores ScoreValue
from Table1
union all
select EmpID , [Year], 2010Scores ScoreValue
from Table1
select empid, Year = '2008', 2008Scores as ScoreValue
where empid = 2
union
select empid, Year = '2009', 2009Scores as ScoreValue
where empid = 2
union
select empid, Year = '2010', 2010Scores as ScoreValue
where empid = 2
select empid, Year = '2008', 2008Scores as ScoreValue
from employeetable
where empid = 2
union
select empid, Year = '2009', 2009Scores as ScoreValue
from employeetable
where empid = 2
union
select empid, Year = '2010', 2010Scores as ScoreValue
from employee table
where empid = 2
0
Question has a verified solution.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Open in new window
Open in new window