Home >Backend Development >PHP Tutorial >mysql 更新有关问题

mysql 更新有关问题

WBOY
WBOYOriginal
2016-06-13 11:22:28881browse

mysql 更新问题
UPDATE cg_disease_department AS a SET a.department_id = 
  SELECT department_id FROM cg_department AS b WHERE a.department_name = b.name

我的需求是 将b表的departmentid 更新到 a表的departmentid 条件是 a.department_name = b.name

我这sql问题在那

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn