Solved

how do i convert reqular SELECT statement to Sql Server Pivot

Posted on 2011-09-14
2
274 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

22 Experts available now in Live!

Get 1:1 Help Now