how to sort top max n values in ms sql server

hi, i want to get the higest value first.  like how can i sort value in the table is such a way that they should be arranged by top max n value..
gmnasirAsked:
Who is Participating?
 
WadskiConnect With a Mentor IT DirectorCommented:
Hi there gmnasir,

at the bottom of your sql statement you need to add:

Order By VALUE desc

W3schools has a tutorial on ordering SQL Statements

http://www.w3schools.com/sql/sql_orderby.asp

Regards

Wadski
0
 
brady1408Connect With a Mentor Commented:
you might have better luck in the db section under microsoft sql but in the mean time you can sort by doing this

Select * from Table Order By Field Asc or Desc you canuse as many fields as you like just seperate them with a comma
SELECT * FROM Table ORDER BY FieldA DESC, FieldB ASC, FieldC ASC
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.