I am struck at writing a query. Here I want to show the column name based on some specific value
For Instance, my table is like this:
id | fruits
As you encrypted your question as much as possible, I can only guess.
this table smells of a bad design. And it should be like
col | value col1 | a col1 | b col2 | d
and so on.
than you can easily get your col out from value