SQL Update one table based on conditions in another table

Two tables.

Content (table),
   topic_id (primary key),
   data (text)

Topics (table),
   topic_id (primary key),
   content_type (text)

Both tables have the same primary key data (topic_id).

I need to update the data field (Content table) with the text "disabled" but only where the content_type field (Topics table) = the text "rvf"

I can: SELECT * from topics WHERE content_type = "rvf";

I can: UPDATE content SET data = ("disabled");

But how can I put those together.

12
задан Brian Tompsett - 汤莱恩 10 August 2017 в 10:34
поделиться