You need to join back to the data to get the top customer. So, first calculate the maximum amount in each month, then join back to get the customer with that amount:
select my.year, my.month, myc.customerid, myc.totord
from (select year, month, max(totord) as maxtotord
from (SELECT YEAR ( Orderdate ) Year, MONTHNAME ( Orderdate ) Month, customerid, COUNT(*) TotOrd ,
FROM orders
GROUP BY YEAR ( Orderdate ), MONTH ( Orderdate ), customerid
) myc
group by year, month
) my join
(SELECT YEAR ( Orderdate ) Year, MONTHNAME ( Orderdate ) Month, customerid, COUNT(*) TotOrd ,
FROM orders
GROUP BY YEAR ( Orderdate ), MONTH ( Orderdate ), customerid, count(*) as totord
) myc
on my.year = myc.year and my.month = myc.month and my.maxtotord = myc.totord
Note that this is untested, so there might be a syntax error.
Also, this returns multiple customers if there are multiple customers with the max value.
Finally, this is much easier in almost any other database, because most databases now support the row_number()
function.