0 votes 0 votes I have read in theory that multiple aggregation = innermost aggregation ,So I was expecting result as min(price) BUT when I run this program on www.w3school.com <SQL> ,showing result as misuse of aggregation function min() !! Databases databases + – AJAY KUMAR ARYAN asked May 24, 2016 AJAY KUMAR ARYAN 450 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
6 votes 6 votes select max(min(price)) from product; This will return minimum price. Because min(price) will get executed first and returns the only one value which is the minimum, now max() will start executing, which have only one value hence it will return that minimum. Read this for more insight. rude answered May 24, 2016 rude comment Share Follow See 1 comment See all 1 1 comment reply namanom1 commented May 27, 2016 i edited by namanom1 May 28, 2016 reply Follow Share i had the command run in ORACLE 11g i had the table as table1={1,2,3} if i wrote select min(max(A)) from table1 group by A : it gave me the minimum value if i wrote select max(min(A)) from table1 group by A : it gave me the maximum value select avg(max(A)) from table1 group by A or if i wrote select avg(min(A)) from table1 group by A then it gave the same result that is average of the values of A. though the inner query is executed first but the answer might vary according to which attribute is it being grouped by. 1 votes 1 votes Please log in or register to add a comment.
0 votes 0 votes it wil return min price only kvkumar answered Jun 2, 2016 kvkumar comment Share Follow See all 0 reply Please log in or register to add a comment.