Hide Empty columns

前端 未结 4 639
野性不改
野性不改 2021-01-14 14:07

I got a table with 75 columns,. what is the sql statement to display only the columns with values in in ?

thanks

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-14 14:28

    A simplified version of this is to just select the relevant columns, which was what I needed personally. A quick search of what we're dealing with in a table

    SELECT * FROM table1 LIMIT 10;
    

    -> shows 20 columns where im interested in 3 of them. Limit is just to not overflow the console.

    SELECT column1,column3,colum19 FROM table1 WHERE column3='valueX';
    

    It is a bit of a manual filter but it works for what I need.

提交回复
热议问题