UPDATE TABLE_A t
JOIN
( SELECT type
, MIN(value) AS value
FROM TABLE_A
GROUP BY type
HAVING COUNT(DISTINCT value) = 1
) AS tu
ON tu.type = t.type
SET t.value = tu.value
WHERE t.value IS NULL
Seperti yang ditunjukkan Peufeu, DISTINCT
diperlukan untuk menangkap kasus seperti ini, di mana saya kira baris id=3 harus diperbarui juga:
TABLE-A
id | type | value
1 | 10 | 123456
2 | 10 | 123456
3 | 10 | NULL
4 | 20 | 123456
5 | 20 | 654321
6 | 20 | NULL