How to select all the columns of a table except one column?

前端 未结 13 2436
被撕碎了的回忆
被撕碎了的回忆 2020-12-14 05:43

How to select all the columns of a table except one column?

I have nearly 259 columns I cant mention 258 columns in SELECT statement.

Is there

13条回答
  •  无人及你
    2020-12-14 06:11

    There are lot of options available , one of them is :

     CREATE TEMPORARY TABLE temp_tb SELECT * FROM orig_tb;
     ALTER TABLE temp_tb DROP col_x;
     SELECT * FROM temp_tb;
    

    Here the col_x is the column which u dont want to include in select statement.

    Take a look at this question : Select all columns except one in MySQL?

提交回复
热议问题