Why do you create a View in a database?

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

    I like to use views over stored procedures when I am only running a query. Views can also simplify security, can be used to ease inserts/updates to multiple tables, and can be used to snapshot/materialize data (run a long-running query, and keep the results cached).

    I've used materialized views for run longing queries that are not required to be kept accurate in real time.

    0 讨论(0)
提交回复
热议问题