Tanto per cominciare, non ti serve affatto un terzo join. Puoi integrare il calcolo in un unico join:
from (
select id from owner
where date_format(auction_date,'%Y-%m-%d %H:%i:00') = date_format(NOW(),'%Y-%m-%d %H:%i:00')
) as a
left join (
select owner_id, max(nb) as maxbid, max(mb) as maxautobi
from auction
group by owner_id
) b on a.id = b.owner_id; Per recuperare il secondo mb più grande si ricorre a un piccolo trucco che combina substring_index() con group_concat():
from (
select id from owner
where date_format(auction_date,'%Y-%m-%d %H:%i:00') = date_format(NOW(),'%Y-%m-%d %H:%i:00')
) as a
left join (
select owner_id, max(nb) as maxbid, max(mb) as maxautobi,
substring_index(substring_index(group_concat(mb order by mb desc), ',', 2), ',', -1) as second_mb
from auction
group by owner_id
) b on a.id = b.owner_id; L'idea è concatenare i valori ordinati per mb e poi estrarre il secondo elemento di quella lista. L'unico inconveniente è che il valore viene restituito come stringa di caratteri, anche quando in origine era un numero.