dblab=# select m.mes_typos, m.mes_onoma, max(d.diaf_kostos) from diafimisi as d, meso as m where d.diaf_mes_kwdik = m.mes_kwdikos group by m.mes_typos,m.mes_onoma;
mes_typos | mes_onoma | max
-----------+--------------+---------------
internet | www.texnh.gr | $5,000,000.00
efimerida | proto thema | $50,000.00
tv | ET1 | $10,000.00
efimerida | ta nea | $30,000.00
(4 rows)
dblab=# select m.mes_typos, max(d.diaf_kostos) from diafimisi as d, meso as m where d.diaf_mes_kwdik = m.mes_kwdikos group by m.mes_typos;
mes_typos | max
-----------+---------------
efimerida | $50,000.00
tv | $10,000.00
internet | $5,000,000.00
(3 rows)
dblab=#