SELECT rendeles_frissit(rm.tetel_kod)
  FROM raktar_mozgas rm
  INNER JOIN raktar_mozgas_fej rmf ON rmf.kod = rm.fej_kod AND rmf.bizonylat_fajta = 11
 GROUP BY rm.tetel_kod;

SELECT rendeles_rendezes(0);