source_tbl: email_addr, role
target_tbl: email_addr, roles
source_tbl can have many email addresses. target_tbl can have one distinct email address (the role in source_tbl is consolidated into roles in target_tbl - just fyi)
My concern is not duplicating email address in target_tbl (no constraints are in place by dba setup)
I have a suspicion that the the sub-query inside a Insert into Select is done once, and that result set is then used by the insert. If this is the case then a query like this won't work:
insert into target_tbl
( email_addr, roles)
select
src.email_addr,
src.role
from source_tbl src
where src.email_address not in ( select email_addr from target_tbl)
can't find anything that confirms my suspicion, checking to see if someone can point me to documentation that gives me this confirmation