Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

How to use PIVOT on two columns

$
0
0

Hi ,

I have used PIVOT many times, but i only used one measure column instead of two. Can i use PIVOT to get two measure. Please see the example below. I have the following table

Dept	CV	      Units
CS	525685.11	99
HR/FS	19625	        60
NSO	9586.12  	 3
SO	193801.49	70

What i want to achieve is

CSCVCSUNITSHR/FSCVHR/FSUNITS NSOCVNSOUNITS   SOCVSOUNITS
525685.1       9919625       609586.12   3193801.5   70

I was able to achieve if either its CV or UNITS, but not both, is there a document on this?

Thanks


SV


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>