There is a query that finds the maximum circulation of newspapers produced, it works:
SELECT MAX(SUM(COUNT)) FROM DELIVERY, NEWSPAPER WHERE DELIVERY.IDNEWSPAPERKEY=NEWSPAPER.IDNEWSPAPER GROUP BY NEWSPAPER.IDNEWSPAPER I need to pull out the second parameter, for example the ID of the newspaper with the maximum circulation, if I add another parameter as in the query below:
SELECT IDNEWSPAPER, MAX(SUM(COUNT)) FROM DELIVERY, NEWSPAPER WHERE DELIVERY.IDNEWSPAPERKEY=NEWSPAPER.IDNEWSPAPER GROUP BY NEWSPAPER.IDNEWSPAPER the error takes off:
not a single-group group function Tell me how to solve this problem?