I understand the MAX function returns a maximum value from a given column for a numeric column. I want to return the maximum count of a column. The below table has two columns maker, product.
maker product
A Printer
B Laptop
B Laptop
A Printer
A Monitor
A Printer
A Scanner
But when I run the query '''select maker, max(type) from table group by maker; ''' I am getting the result as
maker product
A Monitor
B Laptop
I want which product has a maximum count with respect to the maker like below.
maker product
A Printer
B Laptop
Note: As maker count differs, we can't set a common number in Having clause.