PDC_REPORT_CreazioneDB/sql/Collaudo/procedure/C6Mart_PL_S184CoerenzaESG.sql
2025-06-10 15:29:00 +02:00

24 lines
869 B
SQL

--Inv Investimento 021233XY004 BLACK ROCK EQT X 20230215 99999999 300000.000 0.000 300000.000
-- Stored procedure
-- =============================================
-- Author: Simone D'Elia
-- Create date: Aprile 2022
-- Description:
-- =============================================
create procedure [C6Mart].[PL_S184CoerenzaESG] --'S','DGSMHL70H08Z404F'
-- Add the parameters for the stored procedure here
@Rete char(1),
@CodiceFiscale varchar(16)
AS
BEGIN
select Rete,
Codice_Fiscale,
case when percESG=25.00 then 'Almeno pari al 25%'
when percESG=50.00 then 'Almeno pari al 50%'
when percESG=75.00 then 'Almeno pari al 75%'
else 'n.d.' end as percESG,
pesoSostESG,
case when pesoSostESG>=percESG then 'S' else 'N' end as Coerenza
from C6Staging.VAR_ADEGUATEZZA_INDICATORI
where Rete=@Rete and CODICE_FISCALE=@CodiceFiscale
END