What is the reason not to use select *?

后端 未结 20 2747
独厮守ぢ
独厮守ぢ 2020-11-21 07:14

I\'ve seen a number of people claim that you should specifically name each column you want in your select query.

Assuming I\'m going to use all of the columns anyway

20条回答
  •  悲&欢浪女
    2020-11-21 08:12

    To answer you question directly: Do not use "SELECT *" when it makes your code more fragle to changes to the underlying tables. Your code should break only when a change is made to the table that directly affects requirments of your program.

    Your application should take advantage of the abstraction layer that Relational access provides.

提交回复
热议问题