I have a column with 90% null values, I am trying to use the remaining 10% to pick a value randomly everytime and use it to fill the missing vlues in the exact same table.
this is my table
I am using this query to do it on PostgreSQL :
UPDATE public."Assure"
SET "codePostal" = (
SELECT "codePostal"
FROM public."Assure"
WHERE "codePostal" is not NULL
ORDER BY random() * public."Assure"."CodeAssure_id"
LIMIT 1 )
WHERE "codePostal" is NULL
result :
Aucun commentaire:
Enregistrer un commentaire