Why do you create a View in a database?

前端 未结 25 1965
一个人的身影
一个人的身影 2020-11-28 17:10

When and Why does some one decide that they need to create a View in their database? Why not just run a normal stored procedure or select?

25条回答
  •  攒了一身酷
    2020-11-28 17:44

    Among other things, it can be used for security. If you have a "customer" table, you might want to give all of your sales people access to the name, address, zipcode, etc. fields, but not credit_card_number. You can create a view that only includes the columns they need access to and then grant them access on the view.

提交回复
热议问题