Why do you create a View in a database?

前端 未结 25 1963
一个人的身影
一个人的身影 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:39

    Here are two common reasons:

    You can use it for security. Grant no permissions on the main table and create views that limits column or row access and grant permissions to users to see the view.

    You can use use it for convenience. Join together some tables that you use together all the time in the view. This can make queries consistent and easier.

提交回复
热议问题