I am using a MySQL stored function where I have created a function and I have passed column name as a parameter to this function. Suppose
CREATE DEFINER=`root`@`localhost` FUNCTION `test_func`(column_1 varchar(100)) RETURNS varchar(100) CHARSET latin1
select column_1 from table where id = 1 ;
Here I want to get the value of column 'column_1' with id 1. But I am getting the column name itself not the value.
Please help me to write the correct syntax.