Why is SELECT * considered harmful?

后端 未结 15 1560
野的像风
野的像风 2020-11-21 04:12

Why is SELECT * bad practice? Wouldn\'t it mean less code to change if you added a new column you wanted?

I understand that SELECT COUNT(*)

15条回答
  •  忘掉有多难
    2020-11-21 04:59

    Reference taken from this article.

    Never go with "SELECT *",

    I have found only one reason to use "SELECT *"

    If you have special requirements and created dynamic environment when add or delete column automatically handle by application code. In this special case you don’t require to change application and database code and this will automatically affect on production environment. In this case you can use “SELECT *”.

提交回复
热议问题