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

Pivot Query

$
0
0

Hi ALL ,

I have Data in below Format in my SQl Server  table

Month Price Category  Days
Jan 12 Average 40
Jan 13 Non 50
jan 12 Required 60
Jan 34 Average 33
Jan 56 Non 44
Jan 54 Required 60
Jan 34 Average 70
Feb 323 Non 80
Feb 23 Required 90
Feb 21 Average 100
Feb 10 Non 40
Feb 12 Required 58


Requirement is in below format  :


Month Sum of Price Sum Of Days
Jan 193 357
Average 58 143
Non 69 94
Required 66 120
Feb 389 368
Average 21 100
Non 333 120
Required 35 148


kindly Help

Thanks

Priya



Viewing all articles
Browse latest Browse all 23857

Trending Articles



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