update lighting_weather_info set `status`='' where weather_info_id in( select * from (select weather_info_id
FROM lighting_weather_info
WHERE (CONVERT(pa_hp,DECIMAL)>(select indexhightvalue
FROM lighting_equipment_index
WHERE indexcode='pa_hp') or CONVERT(pa_hp,DECIMAL) < (select indexlowvalue
FROM lighting_equipment_index
WHERE indexcode='pa_hp')) and equipmentid='AY1009' and (updatetime BETWEEN '2019-03-12 18:46:46' and '2019-12-12 18:46:46')) sd)
解决 在update之后 加上 IGNORE
update **IGNORE** lighting_weather_info set `status`='' where weather_info_id in( select * from (select weather_info_id
FROM lighting_weather_info
WHERE (CONVERT(pa_hp,DECIMAL)>(select indexhightvalue
FROM lighting_equipment_index
WHERE indexcode='pa_hp') or CONVERT(pa_hp,DECIMAL) < (select indexlowvalue
FROM lighting_equipment_index
WHERE indexcode='pa_hp')) and equipmentid='AY1009' and (updatetime BETWEEN '2019-03-12 18:46:46' and '2019-12-12 18:46:46')) sd)