79278207

Date: 2024-12-13 11:55:42
Score: 0.5
Natty:
Report link

Okay so I managed to come up with a solution/strategy that worked for me. Thank you @AlexPoole for informing me about removing the 0x hex prefix when checking for equality!

-- 1. Add temporary column
ALTER TABLE my_table
ADD country_codes_tmp VARCHAR2(255);

-- 2. Populate new column with converted data from old column
UPDATE my_table SET country_codes_tmp = '[no]' WHERE country_codes = 'ACED0005757200135B4C6A6176612E6C616E672E537472696E673BADD256E7E91D7B470200007870000000017400026E6F';
UPDATE my_table SET country_codes_tmp = '[BOL]' WHERE country_codes = 'ACED0005757200135B4C6A6176612E6C616E672E537472696E673BADD256E7E91D7B47020000787000000001740003424F4C';
--- ...

-- 3. Drop old column
ALTER TABLE my_table 
DROP (country_codes);

-- 4. Rename temporary column to original column name
ALTER TABLE my_table
RENAME COLUMN country_codes_tmp to country_codes
Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Whitelisted phrase (-1): worked for me
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @AlexPoole
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Nermin