sql - How to Pivot multiple columns into rows -


i having sample query data table:

sample data

i want output table like:

output sample data

i tried using pivot operator not possible sum them all.

select      *      (         select * woddb.citystock_unpivot     ) tblcity     unpivot     (         outputvalue [outputfieldname] in (sales, stock, [target])     ) unpvt     pivot     (         sum(outputvalue)         category in (panel,ac,ref)     ) pvt 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -