条件不同值不同更新语句
update `testtime` t2 set type = (select case when t2.date1>t2.date2 then 1 else 0 end) where t2.id = 1
SQL语句
原文:https://www.cnblogs.com/gflyx/p/12145274.html