内部联接后为只读(MySQL) [英] Read-only after inner join (MySQL)

查看:118
本文介绍了内部联接后为只读(MySQL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MySQL工作台(Mac OS)中,我想连接两个表,以便可以更新第二个表.我输入的代码如下

In MySQL workbench (Mac OS), I wanted to join two tables so that I can update the second one. The code I put in was as follows

select f.company, f.remarks, c.pic
from feedback f, customers c
where f.col = c.col
order by f.company;

输出为只读表,这使我无法基于f.remarks列更新表"customers".

The output is a read only table, which prevented me from updating table "customers" based on the f.remarks column.

对您的建议/建议表示赞赏.谢谢.

Your advice/suggestion is appreciated. Thank you.

推荐答案

通过将鼠标悬停在只读"图标上方,我收到以下消息: 声明必须是来自具有主键的单个表中的SELECT,其结果才能可编辑."

By hovering above the "Read Only" icon, I got the following message: "Statement must be a SELECT from a single table with a primary key for its results to be editable".

根据其他编码人员的建议进行研究后,需要注意以下几点:

After some research based on the advice given by fellow coders, here are some points to note:

  1. 在MySQL工作台中,无法编辑从任何JOIN获得的结果,因为它不是来自单个表;
  2. 在单个表中使用SELECT时,必须包含主键才能使结果可编辑.

感谢所有对此问题做出贡献的人.我很感激.

Thank you to everyone who contributed to the question. I appreciate it.

这篇关于内部联接后为只读(MySQL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆