Aggiunta modello + vista e stored x calcolo statistiche chiamate
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
CREATE VIEW [dbo].[v_StatsCall]
|
||||
AS
|
||||
|
||||
WITH cteDati AS
|
||||
(
|
||||
SELECT YEAR(DataRif) AS YearRef, CodInst, CodApp, SUM(NumCall) AS TotCall
|
||||
FROM LogCall
|
||||
GROUP BY YEAR(DataRif), CodInst, CodApp
|
||||
)
|
||||
|
||||
SELECT *
|
||||
FROM cteDati
|
||||
ORDER BY YearRef DESC, TotCall DESC
|
||||
|
||||
GO
|
||||
Reference in New Issue
Block a user