CREATE OR REPLACE VIEW food600.sneodcitane
 AS
 SELECT LEFT(sk__sez.uzaverka::text, 6) AS mesiac,
    sk__sez.id_man,
    sk__sez.c_data::bigint AS c_data,
    count(sk__sez.id_man) AS pocetu
   FROM food600.sk__sez
  WHERE sk__sez.odecteno = 0 AND NOT substr(sk__sez.uzaverka::text, 15, 3) = '***'::text AND NOT sk__sez.id_man = ''::bpchar
  GROUP BY LEFT(sk__sez.uzaverka::text, 6), sk__sez.id_man, sk__sez.c_data;

