Search code examples
sqlsql-serversortinggroup-bysql-order-by

Group/Sort rows with column same value together in groups and order each group by date DESC


I have the following table and want to group/sort rows that have same Name column value together and then sort each group by Date column.

enter image description here

So, the expected result is like this:

enter image description here


Solution

  • If i understand your question properly then try this select * from tbl group by Name order by Name,Date