CREATE OR REPLACE VIEW NP0
(IDCALEND, POSTI_LIBERI)
AS 
SELECT   v.idcalend, COUNT (*) AS posti_liberi
       FROM vendite v, bglok b
      WHERE
     v.idcalend = b.idcalend
     AND
     v.tipo <> 'A'
     and
     v.idposto <> 'X'
   GROUP BY v.idcalend
/


