gpt4 book ai didi

mysql - SQL 中的变量/For Each

转载 作者:行者123 更新时间:2023-11-29 07:25:42 27 4
gpt4 key购买 nike

所以我知道我应该在插入之前检查一下这一点,但我做了一个 SQL 插入,在几行上插入了错误的日期。纠正这个问题的公式是

accounts.timely_date = accounts.due_date + 45 天
其中accounts.facility_id = 44

有没有办法在sql中同时对多行执行此操作?

最佳答案

您可以使用 UPDATE 查询:

update accounts
set
timely_date = due_date + interval 45 day
where
facility_id = 44

关于mysql - SQL 中的变量/For Each,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34616913/

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