Hi,
Thanks for the reply on my previous thread. I have few more questions.
1. When using pagination for some reason, sorting disappears and also try to sort the data in query does not work.
2. Suppose I have drop down based on which I would like to show reports. Drop down values are nothing but column names based on which i need to sum(column_name) in select query. When I do declare and set the variable with column name and passed it in query it does not work.
Sniffet of the code is
DECLARE vcolumn VARCHAR(100)
IF t = 'Revenue' THEN
vcolumn = 'revenue';
END IF;
select items,sum(vcolumn) as earnings from my_table group by items;
This always throws 0 revenue. If I remove single quotes, then it says revenue column does not exists.
Thanks in advance for your response.