Skip to content
Advertisement

Group by one Column in Sql Server and Order by Another Column not contained in either an aggregate function or the GROUP BY clause

i have table “ApplicationEventsSearch” with two column Keyword and EventDate i want to have a query that return result as distinct keyword , but ordered asc by EventDate i have tried many combination , but none worked

Data

Desired Result

and what i have tried so far

Advertisement

Answer

Aren’t you after just MIN or MAX in the ORDER BY?

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement