So basically, I have a simple Database with only one table (it's a test DB).
The table has 4 columns:
SELECT nom, MAX(avg)
SELECT nom, (noteOrale + noteEcrit)/2 as avg
GROUP BY nom) AS Table;
order by and
limit. No subquery is necessary:
SELECT nom, (noteOrale + noteEcrit)/2 as avg FROM etudiant ORDER BY avg DESC LIMIT 1;
It would appear that no
GROUP BY is needed either, because the values are all on one row.
If they are multiple rows, then you need