Ci siamo quasi,
il MIN() era esattamente la funzione che mi serviva.
Questa e' la query che sto utilizzando ora:
codice:
select count(m.id) as matchnumber, t.id, t.name_".LANGUAGE.", MIN(m.roundinfo) as roundinfo
from tournament as t
join matchlist as m on (m.tournament_id = t.id)
where m.date >= CURDATE() $where
group by t.id
HAVING matchnumber > 5
order by m.roundinfo asc
E il risultato che ottengo e':
codice:
Array
(
[0] => Array
(
[matchnumber] => 5
[id] => 34
[name_en] => Torneo 1
[roundinfo] => 1
)
[1] => Array
(
[matchnumber] => 380
[id] => 33
[name_en] => Torneo 2
[roundinfo] => 1
)
)
Il problema e' che il torneo 2 ha 380 matchnumber che e' la totalita del campionato, mentre dovrebbe resituirmi 10 che e' la totalità del roundinfo 1
Antonio