0

I use mariadb and my question is, is there a way to return the value most repeated value inside a column using the MAX( ) function?

I did IT using LIMIT but I should do it with MAX.

SELECT categoría
    FROM (SELECT  categoría, COUNT(categoría) cuenta    
        FROM  cliente GROUP BY categoría ORDER BY cuenta DESC LIMIT 1)AS consulta;
  • why? Are you concerned about performance or are you required to use max for some reason? your limit approach is a commonly accepted method. Alternatives: https://stackoverflow.com/questions/2436820/can-i-do-a-maxcount-in-sql – xQbert Mar 16 '22 at 17:52

0 Answers0