Selecting all columns that start with XXX using a wildcard?

前端 未结 5 2262
一生所求
一生所求 2020-11-29 10:58

I have several columns in my databases with similar names. How do I select those based on the word they start with? Here\'s an example table layout:

5条回答
  •  一整个雨季
    2020-11-29 11:42

    Convert your database to one with three columns:

    Product_type (vegetable, fruit, etc) 
    
    Name (apple, carrot, etc) 
    
    color (orange, yellow, etc)
    

    Now you can use your wildcard to obtain only a certain type, because it now is IN a columns, not in the header.

提交回复
热议问题