I would like to concatenate column names in a way that the first part of the column name is a string and the second part is a number which is the result of another query.
For example:
SELECT CONCAT('column', mytable.mycolumn) FROM table ...
Can this be done in some way. This way it doesn't give me errors but I don't get the expected result and it seems the concatenation doesn' work.
UPDATE: It seems it can't be done. I solved it by concatenating in PHP which means I use two queries instead of one. The question of (in)sufficient normalization is legitimate but will be asked another time. Thanks for all the input.