?
Solved

Data Pivot - SQL 2008

Posted on 2011-09-27
2
Medium Priority
?
178 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
vdr1620 earned 2000 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Suggested Courses

777 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