SELECT DOTAZ2.KLIENT, DOTAZ2.ODBER, DOTAZ1.PRUMER
FROM
(select KLIENT.NAZEV_KL as KLIENT,
SUM(ODECTY.KON_STAV-ODECTY.POC_STAV) as ODBER
from ODECTY, MERIDLO, KLIENT
where MERIDLO.ID_KLIENTA =KLIENT.ID_KLIENTA
and MERIDLO.OZN_MERIDLA =ODECTY.OZN_MERIDLA
and ODECTY.ID_OBD = 1
group by KLIENT.NAZEV_KL) DOTAZ2,
(select avg(ODECTY.KON_STAV-ODECTY.POC_STAV) as PRUMER
from ODECTY WHERE ID_OBD = 1) DOTAZ1
where DOTAZ2.ODBER > DOTAZ1.PRUMER