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

后端 未结 30 2590
花落未央
花落未央 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-21 23:45

    I do not know of any database that supports this (SQL Server, MySQL, Oracle, PostgreSQL). It is definitely not part of the SQL standards so I think you have to specify only the columns you want.

    You could of course build your SQL statement dynamically and have the server execute it. But this opens up the possibility for SQL injection..

提交回复
热议问题