gpt4 book ai didi

mysql - MySQL 更新与 View 连接时出现问题

转载 作者:行者123 更新时间:2023-11-30 01:28:47 24 4
gpt4 key购买 nike

我正在尝试使用 View 中的值更新表。目前我正在使用此代码:

更新成员,temp_status_date
SET member.status_date = temp_status_date.status_date
WHERE member.status_date != temp_status_date.status_date

PHPMyadmin 中给出错误“#1054 - 'where 子句' 中的未知列 'temp_status_date.status_date'”我究竟做错了什么?根据 MySQL 官方文档,这不是正确的语法吗?

最佳答案

试试这个:

UPDATE member JOIN temp_status_date ON
member.status_date != temp_status_date.status_date
SET member.status_date = temp_status_date.status_date;

关于mysql - MySQL 更新与 View 连接时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17704791/

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