如何将选择语句转换为更新语句

时间:2019-05-24 12:09:46

标签: mysql select update-statement

如何将此选择语句转换为更新语句?

(目标:计算体重增加)

select we.*,
        we.weight_evening - (select weight_evening
                             from Weight
                             where color = pg.color          
                             and date < we.date             
                             order by we.date desc
                             limit 1                            
                            ) as weight_increasement
from Weight we
where color = "red"

0 个答案:

没有答案