add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create table t (DeviceID int, ThresholdType int, ThresholdValue int);
insert into t (DeviceID, ThresholdType, ThresholdValue) values
(1, 0, 5),
(1, 1, 10),
(2, 0, 15),
(2, 1, 20);
4 rows affected
update t
set ThresholdValue = (
select x.ThresholdValue
from t x
where x.DeviceID = t.DeviceID and x.ThresholdType <> t.ThresholdType
)
4 rows affected
select * from t;
DeviceID ThresholdType ThresholdValue
1 0 10
1 1 5
2 0 20
2 1 15