clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 921257 fiddles created (11947 in the last week).

CREATE TABLE tablename ([A] int, [B] varchar(10), [C] int, [D] int, [E] decimal(10, 2), [F] int) ; INSERT INTO tablename ([A], [B], [C], [D], [E], [F]) VALUES (00002471, 'Sd3a28d471', 0, 24.00, 377.500000, 1), (00002471, 'Sd3a28d471', 0, 353.50, 377.500000, 1), (00002471, 'Sd3a28d471', 1, 211.00, 211.000000, 1), (00002471, 'Sd3a28e471', 1, 343.00, 343.000000, 1), (00002471, 'Sd3a28e471', 0, 56.00, 242.370000, 1), (00002471, 'Sd3a28e471', 0, 177.06, 242.370000, 1), (00002471, 'Sd3a28e471', 0, 9.31, 242.370000, 1) ;
7 rows affected
 hidden batch(es)


update t set t.f = case when t.e = tt.mine then 1 else 0 end from tablename t inner join ( select a, b, min(e) mine from tablename group by a, b ) tt on tt.a = t.a and tt.b = t.b
7 rows affected
 hidden batch(es)


select * from tablename
A B C D E F
2471 Sd3a28d471 0 24 377.50 0
2471 Sd3a28d471 0 353 377.50 0
2471 Sd3a28d471 1 211 211.00 1
2471 Sd3a28e471 1 343 343.00 0
2471 Sd3a28e471 0 56 242.37 1
2471 Sd3a28e471 0 177 242.37 1
2471 Sd3a28e471 0 9 242.37 1
 hidden batch(es)