update tb_nf_item set 
    id_ncm = tb_item.id_ncm
from tb_nf, tb_item
where
    tb_nf_item.id_emp = tb_nf.id_emp and
    tb_nf_item.id_nf = tb_nf.id_nf and
    tb_nf_item.id_item = tb_item.id_item and
    tb_nf.tp_emis = '[P]' and
    tb_nf.sit not in ('8', '7') and
    tb_nf.dt_emis >= '2016-01-01';