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

Pivot Query help needed

$
0
0

Hi all,

select 
Group_Age,Group_Class,
sum(No_of_OD_Claims)No_of_OD_Claims,
sum(No_of_tp_Claims)No_of_tp_Claims
from dbo.A_Summary_OD_and_TP_1213
group by Group_Age,Group_Class
order by cast(Group_Age as float)
i'm taking this output into excel performing pivot but now i need is

how to write pivot query 

group_age should be column wise and group_class should be in rows. in group_class (1,2,3,4,5,6,7) values are present.

                        group_class

group_age    1 2 3 4 5 6 7

1

2

3

.

.

.

guide me plz


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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