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

后端 未结 30 2504
花落未央
花落未央 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-21 23:52

    no there is no way to do this. maybe you can create custom views if that's feasible in your situation

    EDIT May be if your DB supports execution of dynamic sql u could write an SP and pass the columns u don't want to see to it and let it create the query dynamically and return the result to you. I think this is doable in SQL Server atleast

提交回复
热议问题