If actually there are NULL
s in the column website
instead of ?
then
UPDATE tablename AS t1
SET website = (SELECT MAX(t2.website) FROM tablename t2 WHERE t2.company = t1.company)
WHERE t1.website IS NULL
If there are ?
:
UPDATE tablename AS t1
SET website = COALESCE((
SELECT MAX(t2.website)
FROM tablename t2
WHERE t2.company = t1.company AND t2.website <> t1.website
), t1.website)
WHERE t1.website = '?'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…