Skip to content

Tag: join

MAX COUNT BY GROUP BY Retrieve only max count records

I want to return only the max count record from the following grouping. This Returns: Ideally it should return only : Sort the manufname asc by Tried this but returns the same: Answer You can use dense_rank or rank window function. Also I have removed unnecessary aggregation in the top query. You can use TOP …