I'm working with a weird database schema : the data I'm looking for is stored in one of 30 columns : value1, value2, value3 ... value30
.
Using a query, I know which column number to look up:
How can I use this number to tell mysql to bring me, for each "machine_id", the corresponding "valuex
" column ?
I've read MySQL concat() to create column names to be used in a query? , should I apply that technique or look elsewhere ?