且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在表视图上添加主键?

更新时间:2021-11-14 06:33:24

嗨kingelk,

Hi kingelk,

据我所知,在SQL中, view是一个基于SQL语句结果集的虚拟表。

As far as I know, In SQL, a view is a virtual table based on the result-set of an SQL statement.

视图包含行和列,就像真实表一样。视图中的字段是数据库中一个或多个实际表的字段。因此,您无法在表视图上添加主键。只能将其添加到相关表中。

A view contains rows and columns, just like a real table. The fields in a view are fields from one or more real tables in the database. So you could not add Primary Keys on Table Views. which could only add it to related Table.

祝你好运,

Cole Wu