CREATE OR REPLACE VIEW food600.spol_sum_dph
 AS
 SELECT sk_pol.uzaverka,
    sk_pol.u_cis,
    sk_pol.dan,
    sum(sk_pol.prachy) AS prachy,
    sum(sk_pol.dan) AS dan_pol,
    sk_pol.c_data
   FROM food600.sk_pol
  WHERE btrim(sk_pol.k_odpoctu::text) <> ''::bpchar::text AND btrim(sk_pol.id_man::text) <> ''::bpchar::text AND sk_pol.kompez = 0
  GROUP BY sk_pol.uzaverka, sk_pol.u_cis, sk_pol.dan, sk_pol.c_data;
