I have a table named SHIP_CABINS and its structure is like this:
Name Null? Type
------------- -------- ------------
SHIP_CABIN_ID NOT NULL NUMBER
ROOM_NUMBER NUMBER
TYPE VARCHAR2(10)
SQ_FT NUMBER
I can issue the following queries without using a GROUP BY clause:
SELECT MAX(SQ_FT)
FROM SHIP_CABINS;
SELECT COUNT(*)
FROM SHIP_CABINS;
However, if I nest MAX and COUNT function, I have to use a GROUP BY clause. The following query will fail:
SELECT MAX(COUNT(*))
FROM SHIP_CABINS;
If my table contains 10 rows, why does the above query run without a GROUP BY clause and simple returns 10?