Я пытаюсь обновить значение столбца таблицы PostgreSQL на основе приведенного ниже оператора case.
UPDATE testschema.tbl
SET route_of_admin_class = CASE
WHEN route_of_admin = 'n/a' then NULL
WHEN route_of_admin is null then null
WHEN route_of_admin = '-' then '(null)'
WHEN route_of_admin IN ("other",
"liquids, oils",
"liquids, combination pack",
"vials, dry",
"vials",
"vials, instillation",
"liquids, metered-dose",
"liquids, suspensions",
"powders, medicinal/pharmaceutical solid substances",
"powders, dusting",
"vials, cartridges",
"liquids, syrups",
"powders, granules",
"other special forms - foams",
"liquids, collodion/lacquers",
"vials, unit dose cartridges",
"powders, unit dose",
"vials, other",
"powders, other powders/granules",
"vials, combination pack",
"liquids",
"powders, soluble",
"special solid forms, ocular therapeutic systems",
"powders",
"special solid forms, other",
"liquids, emulsions",
"liquids, unit dose",
"medical aids - diagnostic tests excluding sticks",
"other special forms - other",
"other special forms - food not ready to eat",
"-",
"single-use",
"single-dose",
"multidose",
"interstitial",
"for rx compounding" ) THEN 'other'
else route_of_admin
end
Я получаю следующую ошибку при выполнении вышеуказанного оператора.
[Code: 0, SQL State: 42703] ERROR: column "other" does not exist
Position: 286 [Script position: 8218 - 8226]
Строка, в которой скрипт выдает ошибку:
WHEN route_of_admin IN ("other",
"liquids, oils",
"liquids, combination pack",
"vials, dry",...
Любая помощь высоко ценится!!





Двойные кавычки - для объектов базы данных; используйте одиночные метки для разграничения строковых значений.