Solved

how do i convert reqular SELECT statement to Sql Server Pivot

Posted on 2011-09-14
2
273 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
2 Comments
 
LVL 21

Accepted Solution

by:
JestersGrind earned 250 total points
Comment Utility
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
Comment Utility
Your a cool guy:)

Thanks.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 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

11 Experts available now in Live!

Get 1:1 Help Now