gpt4 book ai didi

mysql - 如何在mysql查询的更新语句中连接多个表

转载 作者:行者123 更新时间:2023-11-30 22:53:46 26 4
gpt4 key购买 nike

<分区>

我有表 my_employees,my_departments , my_emp_details , my_periods
下面的查询是在 oracle 的旧连接语句中,我想用 mysql 语法转换它,但我做不到,请帮忙

UPDATE my_employees a SET 
a.attribute1, a.attribute2, a.attribute3, a.attribute4,
a.attribute5, a.attribute6, a.attribute7, a.attribute8,
a.attribute9, a.attribute10, a.attribute11, a.attribute12,
a.attribute13, a.attribute14, a.attribute15, a.attribute16,
a.attribute17, a.attribute18, a.attribute19, a.attribute20 =
(SELECT b.attribute1, b.attribute2, b.attribute3, b.attribute4,
b.attribute5, b.attribute6, b.attribute7, b.attribute8,
b.attribute9, b.attribute10, b.attribute11, b.attribute12,
b.attribute13, b.attribute14, b.attribute15, b.attribute16,
b.attribute17, b.attribute18, b.attribute19, b.attribute20
FROM my_departments b, my_emp_details c, my_periods p
WHERE b.dept_seq_id(+) = c.dept_seq_id
AND a.person_seq_id = c.person_seq_id
AND c.period_seq_id = p.period_seq_id
AND p.period_status = 'CURRENT')
WHERE a.person_seq_id = l_person_seq_id;

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com