Select all columns except one in MySQL?

后端 未结 30 3502
后悔当初
后悔当初 2020-11-22 00:46

I\'m trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this?

EDIT: There are 53 columns i

30条回答
  •  天命终不由人
    2020-11-22 01:05

    If you use MySQL Workbench you can right-click your table and click Send to sql editor and then Select All Statement This will create an statement where all fields are listed, like this:

    SELECT `purchase_history`.`id`,
        `purchase_history`.`user_id`,
        `purchase_history`.`deleted_at`
    FROM `fs_normal_run_2`.`purchase_history`;
    SELECT * FROM fs_normal_run_2.purchase_history;
    

    Now you can just remove those that you dont want.

提交回复
热议问题