What is the reason not to use select *?

后端 未结 20 3117
独厮守ぢ
独厮守ぢ 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 07:57

    Even if you use every column but address the row array by numeric index you will have problems if you add another row later on.

    So basically it is a question of maintainability! If you don't use the * selector you will not have to worry about your queries.

提交回复
热议问题