Resource id #136
select count(*) from Ordens_Itens  a left join Moeda k on a.pMoe = k.pPId and k.iVer = k.iVAt left join Cambio kk on a.pCam = kk.pPId and kk.iVer = kk.iVAt left join Moeda kk1 on kk.pMoe2 = kk1.pPId and kk1.iVer = kk1.iVAt left join NCM g on a.pNCM = g.pPId and g.iVer = a.fNCM left join UnidadeMedida c on a.pUni = c.pPId and c.iVer = c.iVAt, Itens b, Ordens d where a.lExc = 0 and a.iVer = a.iVAt and a.pOrdem = 1383722 and a.pOrdem = d.pPId and d.iVer = d.iVAt and a.pItem = b.pPId and b.iVer = a.fItem