How do I add an alias to the table
Try like

SELECT MAX(A.count_supplier), A.id FROM
(
    SELECT supplier_id as id, COUNT(*) AS count_supplier
    FROM library.lms_book_details
    GROUP BY supplier_id
) A GROUP BY A.id;


Alias inner COUNT(*) as something different than COUNT as it is good practice to not use it as alias , As i have used count_supplier.