I've been tasked with finding the client with the highest sum of payments, the table they gave me contains the customer number and amount, I have not been able to do this,
SELECT suma.customerNumber, suma.Tot
FROM (
SELECT DISTINCT payments.customerNumber, ROUND(SUM(payments.amount), 2) AS Tot
FROM payments
GROUP BY customerNumber
ORDER BY Tot DESC
) suma
WHERE suma.Tot = (SELECT MAX(Tot) FROM suma)
GROUP BY suma.customerNumber;
This is an example of the kind of code I've been writing to solve this, I know I can't just do MAX(SUM(blah)), but that's basically what I need to do, and I need help.
SELECT TOP 1 ...works for you... which is not the case for MySQL. You need to update your question to reflect the correct RDBMS you are using. And with any limitations given what you have learned in your course.