- select count(*) from fab_ide where --(idimmobile,progressivo) in (select idimmobile,progressivo from fab_ide where UPPER(FAB_IDE.COD_AMM ) = 'L483'
- --and UPPER(FAB_IDE.FOGLIO ) = '7' and exists(select 1 from FAB where FAB.COD_AMM = FAB_IDE.COD_AMM AND FAB.IDFAB = FAB_IDE.IDFAB and FAB.ATTIVO = '1' ) )
- FAB_IDE.IDIDE = 1 AND (FAB_IDE.IDFAB) NOT IN (SELECT IDFAB FROM FAB WHERE X_OKDATINI=2)