Get column name dynamically by Specific row value

前端 未结 2 636
长情又很酷
长情又很酷 2020-12-12 07:40

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            


        
2条回答
  •  一生所求
    2020-12-12 08:24

    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

提交回复
热议问题