Quantcast
Viewing all articles
Browse latest Browse all 16

T-SQL: How do I find the greatest values in a column?

How can write a SELECT statement that finds the n greatest values in a column? From what i’ve read, the TOP statement only returns the first n rows, it doesn’t take any regard to the values. For example, if a have a column with ages, i want to be able to find the 5 oldest [...] Related posts:
  1. Use CAST (or CONVERT) to handle Null Date values in Microsoft SQL Server
  2. How to create an auto-incrementing column in MS SQL Server 2000
  3. SQL SERVER Tutorial – T-SQL: Inserting Data – Identity Values – Delimiters – Insert Multiple Rows

Viewing all articles
Browse latest Browse all 16

Trending Articles