我正在寻找一个UPDATE语句,它将更新具有重复时间戳的行,并仅更新在持续时间列具有最大值的行,我可以在Oracle SQL或PL/SQL中使用。
<表类>
ID
时间
DURARTION
有效的
tbody><<tr>1 12:30 6 - 212:35 2 - 3 12:35 5 - 412:35 9 - 表类>
您可以使用case子句将值更新为TRUE或FALSE。
update TABLE1
set tru_false = case when (TIME, duration) in (select time, max(duration) from TABLE1 group by time)
then 'TRUE'
else 'FALSE'
END
这里是一个小的演示,我希望它会有所帮助