[数据库问题]Can not insert into join view 'xxxx.xxxx' without fields list
问题原因:
所创建的视图依赖了多个基本表,所以不能插入 insert数据。
解决办法:
当视图只依赖了一个基本表,可插入数据。
拓展:
1.插入视图数据:视图依赖多个基本表时,不能insert数据,且插入的数据必须包含所有不为空的列。
2.修改视图数据:视图依赖多个基本表时,则一次只能变动一个基本表。
3.删除视图数据:视图依赖多个基本表时,不能用delete。(删除数据会影响基本表,删除视图不会影响基本表)
同样的,也有可能会出现另一种错误:can't not delete from join view
mysql文档中说明:
"For a view to be updatable, there must be a one-to-one relationship between the rows in the view and the rows in the underlying table."
所以只能是one-to-one 不能有多个基本表

浙公网安备 33010602011771号