PDC_REPORT_CreazioneDB/sql/Produzione/viste/C6MartPeriodico_vBrsClienteESG.sql
2025-06-10 16:47:41 +02:00

18 lines
501 B
SQL

CREATE VIEW [C6MartPeriodico].[vBrsClienteESG]
AS
select * from (
select a.rete,case when isnull(a.codman,'') <> '' then 'FF@' + a.codman
when isnull(a.Piva,'') <> '' and isnull(a.codman,'') = '' then a.Piva
else codicefiscale
end as cod_fiscale,
[Preferenza_esg_cliente]
,[ESG_E]
,[ESG_S]
,[ESG_G]
,[obiettivo_ESG_minimo]
,[ESG_Rating]
,[ESG_E_perc]
,[ESG_S_perc]
,[ESG_G_perc]
from c6stagingperiodico.ESG_Metriche_Cliente_IL a
) a