Description
Monitors scenes where the expected and processed image counts match.
Query :
Monitors scenes where the expected and processed image counts match.
Query :
WITH FilteredData AS (
SELECT A.AssetPurityId, A.ImageCount, A.SceneId, A.SceneUid, A.CountryId, A.ClientId, A.CreatedOn, c.ClientName, d.Country, COUNT(api.AssetPurityId) AS TotalImageCount
FROM AssetPurity A (NOLOCK)
INNER JOIN AssetPurityImage api (NOLOCK) ON api.AssetPurityId = A.AssetPurityId
LEFT JOIN Client c (NOLOCK) ON A.ClientId = c.ClientId LEFT JOIN Country d (NOLOCK) ON A.CountryId = d.CountryId
WHERE A.ClientId IN (SELECT ClientId FROM clientRE (NOLOCK) WHERE HostUrl LIKE '%http%' AND IsDeleted = 0)
AND A.StatusId = 2 AND A.IsDeleted = 0 AND A.ImageTypeId <> 0 AND A.CreatedOn >= '2025-07-30'
AND A.ReportUrl NOT LIKE '%http%' GROUP BY A.AssetPurityId, A.ImageCount, A.SceneId, A.SceneUid, A.CountryId, A.ClientId, A.CreatedOn, c.ClientName, d.Country HAVING COUNT(api.AssetPurityId) = A.ImageCount) SELECT * FROM FilteredData ORDER BY CreatedOn DESC OPTION (RECOMPILE, MAXDOP 1);