All pastes #897863 Raw Edit

Untitled

public text v1 · immutable
·published 2008-02-09 22:05 UTC
rendered paste body
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=# 

select art_xwra, art_onoma, art_eponymo, art_im_genn
from artist 
where (art_im_genn, art_xwra) in  
    (select min(art_im_genn), art_xwra 
    from artist 
    group by art_xwra);