CREATE OR REPLACE VIEW vit.meter_models AS
SELECT
    manufacturer,
    model,
    COUNT(*) AS count
FROM vit.meter
WHERE      
    installationdate <= CURRENT_DATE 
    AND (dismantlingdate IS NULL OR dismantlingdate > CURRENT_DATE) 
GROUP BY manufacturer, model
ORDER BY 
    manufacturer, 
    model;
