• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 182
  • Last Modified:

Data Pivot - SQL 2008

How do i pivot this output ?

XAxis              YAxis
0.997587025      0.002412974

I need it to be like this:
Coordinates     Values
XAxis               0.997587025
YAxis               0.002412974

0
byte1
Asked:
byte1
1 Solution
 
vdr1620Commented:
try this

CREATE TABLE PIVOT_Sales(id INT,X_axis INT, Y_Axis INT)
INSERT PIVOT_Sales VALUES(1,11.00, 12.000)
INSERT PIVOT_Sales VALUES(2,10.00, 15.000)

SELECT Axis,location
FROM (SELECT X_Axis,Y_Axis FROM PIVOT_Sales) AS p
UNPIVOT (location for Axis in (X_Axis,Y_Axis)) AS s
0
 
byte1Author Commented:
Awesome :-)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now