-- creazione viste
DROP VIEW IF EXISTS v_ParetoStatus;

CREATE VIEW v_ParetoStatus AS
SELECT	CodStatus,SUM(Duration) AS TotDuration
FROM	StatusLog 
GROUP BY CodStatus;
