select *,greatest(trimestre1,trimestre2,trimestre3,trimes tre4) as maggiore from tabella