DELETE FROM vclib.t_BASE_FEATURE_SETTINGS bfs
USING vclib.T_CLIENT_MODULE_FEATURE cmf
WHERE bfs.ClientModuleFeature = cmf.ClientModuleFeatureID
  AND cmf.name = 'ArmLocalAdminWorkSpaceWeb'
  AND cmf.ClientModules = (
    SELECT ClientModuleId
    FROM vclib.T_CLIENT_MODULES cm
    WHERE cm.ModuleType = 'HospitalARMSClientModule'
    LIMIT 1
  );

DELETE FROM vclib.T_CLIENT_MODULE_FEATURE
WHERE name = 'ArmLocalAdminWorkSpaceWeb'
  AND ClientModules = (
    SELECT ClientModuleId
    FROM vclib.T_CLIENT_MODULES cm
    WHERE ModuleType = 'HospitalARMSClientModule'
    LIMIT 1
  );