Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个名为 movies 的表,具有以下属性:
id title director and genre(fk)
这里流派列是空的。然后我有流派表:
genreid genre
现在如何填写电影表中的流派列,为每部电影指定流派?
使用UPDATE声明
UPDATE
UPDATE movies SET genre = (SELECT id FROM genres WHERE genre = 'action') WHERE title = 'Batman'