April 14, 2008 at 1:01 am
hi friends,
I'm having an Emp table with three column and three rows,
Select * from Emp, I can get the Following result as below,
Emp-idEmp-Name Dept
1 John Phy
2 Max Chem
3 Jack Phy
how can i achieve the following result using SQL Query to display result in column wise
Emp-id 1 2 3
Emp-Nam John Max Jack
Dept Phy Chem Phy
Thanks in Advance.
windows_mss
___
Known Is An Drop,Unknown Is An Ocean....
Njoy Programming 🙂
April 14, 2008 at 4:09 am
Need this really to be done by SQL.
There are some easier ways to do this.
Like OLAP or Reporting Services or just like MTRANS Function from Excel.
April 14, 2008 at 6:32 am
There's a thousand posts on this... search for "Convert rows to columns".
Also, why do you want to do this? What if a Department has 1,000 employes? How would you display THAT?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply