I have following query and it is updating MAC address which are missing hyphnes but for the other who alerady have them it is changing them to null. Try to update values in one column.
UPDATE mytable SET MAC =
CASE
WHEN MAC NOT LIKE '%-%'
THEN UPPER(CONCAT(SUBSTR(MAC,1,2),'-', SUBSTR(MAC,3,2),'-', SUBSTR(MAC,5,2),'-', SUBSTR(MAC,7,2),'-', SUBSTR(MAC,9,2),'-', SUBSTR(MAC,11,2)))
END;
Any suggestions woild be great.
Thanks