How to select the max value after a count in oracle?

Member

by lizzie , in category: MySQL , 4 months ago

How to select the max value after a count in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by daisha , 4 months ago

@lizzie 

To select the maximum value after performing a count in Oracle, you can use the following query:

1
2
3
4
5
6
SELECT MAX(cnt)
FROM (
    SELECT COUNT(column_name) as cnt
    FROM table_name
    GROUP BY column_name
);


In this query:

  1. Replace column_name and table_name with the specific column and table name from which you are counting values.
  2. The inner query counts the occurrences of each value in the specified column.
  3. The outer query then selects the maximum count value from the result of the inner query.


This query will give you the maximum count value obtained from the count operation in Oracle.