SQL根据另一个表中的条件更新一个表
|
两张桌子。
Content (table),
topic_id (primary key),
data (text)
Topics (table),
topic_id (primary key),
content_type (text)
两个表具有相同的主键数据(topic_id)。
我需要使用文本\“ disabled \”更新数据字段(内容表),但仅在content_type字段(主题表)=文本\“ rvf \”的情况下
我可以:SELECT * from topics WHERE content_type = \"rvf\";
我可以:UPDATE content SET data = (\"disabled\");
但是我怎么把它们放在一起。
没有找到相关结果
已邀请:
2 个回复
痰嫉
联海
您还可以执行以下操作,使用主题中的值更新内容:
不确定是否在这种情况下适用,但是很高兴知道您可以...