0

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.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
user3701188
  • 638
  • 3
  • 7
  • 23
  • You should be able to use a group by and get the data in the way you want. How you display it that is column becomes rows, is based on how you handle that. Why would need to do have the data coming out of the query like that ? – StackFlowed Dec 21 '16 at 20:37
  • how would I use groupby , I would like to have time as my x axis and columns as my multiple y axises. – user3701188 Dec 21 '16 at 20:40
  • http://stackoverflow.com/questions/232387/in-sql-how-can-you-group-by-in-ranges – StackFlowed Dec 21 '16 at 20:48

0 Answers0