mysql 同一张表赋值

update tb_plo_artificialfactor b
set cprefactornum=(SELECT cfactornum from (SELECT *  FROM  tb_plo_artificialfactor) a  WHERE a.cstarttime< b.cstarttime  order by a.cstarttime desc LIMIT 0,1  )  
WHERE cprefactornum is null;

 

posted @ 2021-08-26 10:29  誓鼎  阅读(85)  评论(0编辑  收藏  举报