【发布时间】:2021-03-04 10:25:27
【问题描述】:
我有三张桌子。表名是
- salary_history_table - employee_id(外键)
- employee_table - employee_id(primary) department_structure_id(foreign)
- department_table - department_structure_id(primary)
现在salary_history_table 有一个名为“employee_id”的id,它是employee_table 中的主键。并且employee_table 有一个名为“department_structured_id”的id,它是department_table 中的主键,我的问题是我想根据department_table 中的“department_structured_id”更新salary_history_table 列中名为rate_exempt 的所有数据。如何加入这三个表并根据employee_id 更新与特定id 查询相关的所有内容?
【问题讨论】:
-
你试过什么?之前和之后的样本数据会是什么样子?编辑问题以包含这些详细信息。
标签: php mysql database codeigniter