Maximum Distinguished Values in SQL
please forgive me if this was answered but couldn't find it with a search tool or google main query.
I am trying to return a value that indicates the maximum number of rows in a single value in a SQL column.
For example, I would like to use something like
SELECT MAX(COUNT(DISTINCT person_id) AS MAX_NUM_PERS_ROW
FROM mytable
and if the person with the most rows in the table had 5 rows, the return value would be 5 ...
Any help is appreciated!
+3
source to share
1 answer