Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

dynamic pivot

$
0
0

Here is my intial table t1 and final table t2

based on the parameter passed i need to pivot the table 

t1

RECORDER_IDCHANNEL_NOMDATEvalue
A1KW11/13/2012 0:001072.8
A2KVAR11/13/2012 0:00447.12
A1KW11/13/2012 0:451066.32
A2KVAR11/13/2012 0:45403.2
A1KW11/13/2012 1:001084.32
A2KVAR11/13/2012 1:00419.04
b1KW11/13/2012 0:001167.84
b2KVAR11/13/2012 0:00444.24
b3KW11/13/2012 0:001159.92
b4KVAR11/13/2012 0:00436.32

t2

recorder_idDATECHANNEL_1(kw)CHANNEL_2(KVAR)
a11/13/2012 0:001072.8447.12
11/13/2012 0:001066.32403.2
11/13/2012 0:451084.321084.32
if b is passed DATECHANNEL_1(kw)CHANNEL_2(KVAR)channel_3(kw)ch_4(kvar)
11/13/2012 0:0011674441159436
CHANNEL NO MUST BE DISPLAYED BASED ON RECORDERS ID  AND 
THEN PIVOTED BASED ON THE SELECTION MADE BY CUSTOMER


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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