I want to use the registry as the column name, but the registry is variable, and I don't know when it will change.
Example:
Config (field) = 'Medicine'
FieldContent (another field) = 'Remedy name'
You want to do this:
Medicine (use the contents of Config as a column name) = 'Remedy Name' (as a registry)
What have i tried?
SET @CONFIG = SELECT CONFIG;
SELECT FIELDCONTENT AS @CONFIG FROM TABLENAME;
MySql says that I cannot use the variable as the column name. Is there another way?
current RemedyName Medicine configuration contents
Requires
RemedyName medicine
Thanks!
source
share