?
Solved

how do i convert reqular SELECT statement to Sql Server Pivot

Posted on 2011-09-14
2
Medium Priority
?
279 Views
Last Modified: 2012-05-12
Hello
I have a view as in image1 and would like make a view with PIVOT as in image 2.

Thanks
 Image 1 simple select Image 2 as Pivot
0
Comment
Question by:gabi456
[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 21

Accepted Solution

by:
JestersGrind earned 1000 total points
ID: 36535660
To do a pivot you need something to actually pivot on.  From the screenshot it doesn't appear that you have that.  Is there always exactly 2 records?  If so, you could do something like this to get the same effect.

SELECT NivdakID, MIN(Golmi), MAX(Golmi)
FROM YourTable
GROUP BY NivdakID

Greg

0
 

Author Closing Comment

by:gabi456
ID: 36535702
Your a cool guy:)

Thanks.
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

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

770 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