.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

Sorting with out defining the column in select list when distinct is used

Posted By: Deco     Posted Date: October 30, 2010    Points:2   Category :Sql Server
Please tell me some other way to sort the result set with a particular column when distinct keyword is used/

Author: Syed Shakeer Hussain             
Posted Date: October 30, 2010     Points: 5   


Run this query

SELECT sample_columnFROM [Table] GROUP BY sample_column
ORDER BY COUNT(sample_column) DESC

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend