fix numberofchildren cast

This commit is contained in:
Mathieu Jaumotte 2023-03-01 17:34:47 +01:00
parent b6f26900a7
commit a36ee22be6

View File

@ -169,7 +169,8 @@ UPDATE import.personnes SET maritalstatus1=json_build_object('fr', trim(maritals
-- 25. Prepare personnes numberofchildren
ALTER TABLE import.personnes ADD COLUMN numberofchildren1 integer;
UPDATE import.personnes SET numberofchildren1=to_number(trim(numberofchildren::text) ) WHERE numberofchildren!=''; -- <== case BOUM
UPDATE import.personnes SET numberofchildren1=NULLIF(numberofchildren, '')::int;
-- SELECT numberofchildren, numberofchildren1 FROM import.personnes;
-- 26. Prepare personnes household_composition_type