Solved

Data Pivot - SQL 2008

Posted on 2011-09-27
2
169 Views
Last Modified: 2012-05-12
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
Comment
Question by:byte1
2 Comments
 
LVL 16

Accepted Solution

by:
vdr1620 earned 500 total points
ID: 36709789
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
 

Author Closing Comment

by:byte1
ID: 36709900
Awesome :-)
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Suggested Solutions

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now