I have table 1 with data and table 2 as a lookup table with metadata. I need a query that returns all records from table 1 where either column in table 1 not exists in table two. The following query works fine for one column, but if I use more than one column in my join it´s not. working query:
select
T1.SCENARIO,
T1.year,
T1.period,
T1.ENTITY,
T1.account,
T1.ICP,
T1.MVMTS,
T1.C1,
T1.C2,
T1.C3,
T1.MULTI_GAAP,
T1.VLAUE
from "fccs".MV_FACT_FCCS T1 left outer join "fccs".V_META_NOT_FOUND V2 on trim(T1.account) = trim(V2.account)
where V2.account is null
not working correctly:
select
T1.SCENARIO,
T1.year,
T1.period,
T1.ENTITY,
T1.account,
T1.ICP,
T1.MVMTS,
T1.C1,
T1.C2,
T1.C3,
T1.MULTI_GAAP,
T1.VLAUE
from "fccs".MV_FACT_FCCS T1 left outer join "fccs".V_META_NOT_FOUND V2 on trim(T1.account) = trim(V2.account) and trim(T1.entity) = trim(v2.entity)
where V2.account is null or v2.entity is null
The second query continues to bring the records from table 1 where exist in table 2. Any help appreciated!

