SQL exclude a column using SELECT * [except columnA] FROM tableA?

后端 未结 30 3285
花落未央
花落未央 2020-11-21 23:15

We all know that to select all columns from a table, we can use

SELECT * FROM tableA

Is there a way to exclude column(s) from a table witho

30条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-22 00:04

    No.

    Maintenance-light best practice is to specify only the required columns.

    At least 2 reasons:

    • This makes your contract between client and database stable. Same data, every time
    • Performance, covering indexes

    Edit (July 2011):

    If you drag from Object Explorer the Columns node for a table, it puts a CSV list of columns in the Query Window for you which achieves one of your goals

提交回复
热议问题