mysql transposing columns into rows dynmaically in jdbc project

173 views Asked by At

I'm working on a data visualization jsf project where I need to analyse and visualize data.

I have a mysql database table with lots of columns about 50 or more and I would like to write an sql statement to preprocess (transpose columns into rows) this data in code so I can map it to a java class.

Or a java code that would distribute the values of the columns selected some how to my mapped class according to the range of date selected

Below is an image of the raw data. These are the columns of the raw data

Desired Transformation

columns names as rows(PowerPlants) and values of the columns names under Mean(kilowatts), so if I could have a java class mapping it in this way that would be great so i can populate it on my graph

So this way I can map it to a java class to analyze date and values.

0

There are 0 answers