-- =============================================
-- Author:		Marian Zaki
-- Create date: 29/11/2010
-- Description:	Checks for data validation 
-- =============================================
-- [C6MartPeriodico].[PL_S57ConfrontoPiramidi] 'S','TMOSST58P03L840W'
CREATE procedure [C6MartPeriodico].[CHECK_GET_CTV_ISSUES]
AS
BEGIN
SELECT Rete, Cod_Fiscale , SUM(S57CTV) as S57CTV, SUM(S43_S47CTV) as S43_S47CTV, SUM(S10CTV) as S10CTV ,  SUM(S75CTV) as S75CTV 
FROM Check_DifferenceInCTVPerClient 
where S57CTV <> S43_S47CTV 
OR   S57CTV  <> S10CTV 
OR   S57CTV <>  S75CTV  
group by   Rete, Cod_Fiscale
END