CASE expressions with MAX aggregate functions Oracle
问题 Using Oracle, I have selected the title_id with its the associated month of publication with: SELECT title_id, CASE EXTRACT(month FROM pubdate) WHEN 1 THEN 'Jan' WHEN 2 THEN 'Feb' WHEN 3 THEN 'Mar' WHEN 4 THEN 'Apr' WHEN 5 THEN 'May' WHEN 6 THEN 'Jun' WHEN 7 THEN 'Jul' WHEN 8 THEN 'Aug' WHEN 9 THEN 'Sep' WHEN 10 THEN 'Oct' WHEN 11 THEN 'Nov' ELSE 'Dec' END MONTH FROM TITLES; Using the statement: SELECT MAX(Most_Titles) FROM (SELECT count(title_id) Most_Titles, month FROM (SELECT title_id,