CREATE OR REPLACE VIEW food600.ssk__fis
 AS
 SELECT sk__fis.ucet,
    sk__fis.c_uzaverka,
    sk__fis.fucis,
    sk__fis.fuciarkod,
    sk__fis.fuzcislo,
    sk__fis.fuzdate,
    sk__fis.c_data,
    sk__fis.nedokonceny,
    sk__fis.prn_no,
    sk__fis.okp,
    sk__fis.uid,
    sk__fis.replied,
    sk__fis.ekas_fixed
   FROM food600.sk__fis
UNION
 SELECT sk__fis.ucet,
    sk__fis.c_uzaverka,
    sk__fis.fucis,
    sk__fis.fuciarkod,
    sk__fis.fuzcislo,
    sk__fis.fuzdate,
    sk__fis.c_data,
    sk__fis.nedokonceny,
    sk__fis.prn_no,
    sk__fis.okp,
    sk__fis.uid,
    sk__fis.replied,
    sk__fis.ekas_fixed
   FROM food600.sk__fis
     JOIN food600.sskpltkompez ON sk__fis.c_uzaverka = sskpltkompez.c_uzaverka AND sk__fis.ucet = sskpltkompez.ucet
  WHERE sskpltkompez.cena_pl <> 0::numeric;

