ALTER TABLE PHARM.T_C_MNN ADD "isdrug" boolean NULL;

update PHARM.T_C_MNN mnn
set IsDrug = '1'
from PHARM.T_C_TRN trn 
where trn.CMnn = mnn.CMnnID and trn.IsDrug = '1';

update PHARM.T_C_MNN set IsDrug = '0' where IsDrug is null;

ALTER TABLE PHARM.T_C_MNN ALTER COLUMN "isdrug" SET NOT NULL;

ALTER TABLE PHARM.T_C_TRN DROP COLUMN "isdrug";