PDC_REPORT_CreazioneDB/sql/Collaudo/viste/C6Mart_vRpClientiNonMigrati.sql
2025-06-10 15:29:00 +02:00

56 lines
3.1 KiB
SQL

--select * from [C6Mart].[vRpClientiNonMigrati]
CREATE VIEW [C6Mart].[vRpClientiNonMigrati]
AS
--FC
--SELECT RETE, COD_FISCALE, ID_PROMOTORE
--FROM C6Mart.ANAG_CLIENTI
--WHERE (NOME IS NULL OR NOME = '') AND (COGNOME IS NULL OR COGNOME = '')
SELECT anag.RETE , anag.COD_FISCALE, anag.ID_PROMOTORE,contr.PIVA_FIDUCIARIA
FROM C6Mart.ANAG_CLIENTI anag
inner join c6mart.vcontratti contr
on contr.cod_fiscale=anag.cod_fiscale and contr.rete=anag.rete
WHERE 1=1 /* 20171110 */
and (NOME IS NULL OR NOME = '') AND (COGNOME IS NULL OR COGNOME = '')
and contr.rete+contr.cod_fiscale not in
(
/* 20171110
----'FGRBNLT65D44A859X' /* temp 20161207 */
----,'FPNDLCI41T49F205P' /* temp 20170317 */
----,'FNTRSFN60A29F205X' /* temp 20170413 causa erorre in wrapper console di AllineaPortafoglioClienti */
----,'FRMNSRN50B14G160L' /* temp 20170616 causa erorre in wrapper console di AllineaPortafoglioClienti - upd C6Mart.ANAG_CLIENTI */
----,'SBLDMRK89A43H501E' /* temp 20170705 causa erorre in wrapper console di AllineaPortafoglioClienti - upd C6Mart.ANAG_CLIENTI */
----,'SNVGMNL73A15H501Y'
----,'SMTANDR70P22H501S'
----,'SFLCNTN47B12F631K'
----,'SFF@10093'
----,'FCGODTL56P51G224V' /* temp 20170825 causa erorre in wrapper console di AllineaPortafoglioClienti - upd C6Mart.ANAG_CLIENTI */
----,'SSCTGZM53R41C351H' /* temp 20170919 causa erorre in wrapper console di AllineaPortafoglioClienti */
*/
/* ,'FFRNNCL87D25G224T' 20171110 nome+cognome aggiornato */
/* ,'FGLLFBA57R22F205P' temp 20170922 causa erorre in wrapper console di AllineaPortafoglioClienti
,'STZZFNC51B57D810T' /* temp 20171005 causa erorre in wrapper console di AllineaPortafoglioClienti */
,'SLVORSO76A65D711N' /* temp 20171107 causa erorre in wrapper console di AllineaPortafoglioClienti */
20171110 nome+cognome aggiornato */
--'FFF@10105' /* temp 20171107 causa erorre in wrapper console di AllineaPortafoglioClienti */
-- /* 20171110 AllineaPortafoglioClienti non restiuisce record */
--,'SGBRMCL56B15C390A' /* 20171110 AllineaPortafoglioClienti non restiuisce record */
--,'FGGLSFN69T19A944H' /* 20171112 AllineaPortafoglioClienti non restiuisce record */
--,'SNVGMNL73A15H501Y' /* 20180307 AllineaPortafoglioClienti non restiuisce record */
--,'FCVLNDR85B16C933K' /* 20180307 AllineaPortafoglioClienti non restiuisce record */
--,'SBLDMRK89A43H501E' /* 20180307 AllineaPortafoglioClienti non restiuisce record */
--,'SMTANDR70P22H501S' /* 20180307 AllineaPortafoglioClienti non restiuisce record */
--,'SFF@10052' /* 20180307 AllineaPortafoglioClienti non restiuisce record */
--,'FPRNMRA64P18E130G' /* 20180327 AllineaPortafoglioClienti non restiuisce record */
--'SGLLNMR45B60H400M' /* 20180608 AllineaPortafoglioClienti non restiuisce record */
--'SRSSDLM50M23E958Q' /* 20180608 AllineaPortafoglioClienti non restiuisce record */
--'SMNIBLD57S25F908U'
--'SDSNBBR71C62G482V'
--'STRBGNE55D14L291R'
--'FDNNSFN70A62F205G'
--'SMNRGNN59R20L291G'
--'FLNZGPP44A24D390F',
--'FMNTRRT57L12I608F',
--'FDTTLCU74T53E379G',
--'FTRMMHL91L21L219Z',
'SVGDGMN54S18A794O'
)