Top

SQLServerCentral Article

A Plunge Into TOP

  • Article

Introduction TOP is one of the many syntactical operators available in T-SQL and at a first view, it could seem very simple and not particularly interesting. According to the official documentation, it “limits the rows returned in a query result set to a specified number of rows or percentage of rows”. The following is the […]

5 (6)

You rated this post out of 5. Change rating

2019-06-04

5,087 reads

External Article

Selecting Data Using the TOP Clause

  • Article

There are times when you don’t what to return a complete set of records. When you have this kind of requirement to only select the TOP X number of items Transact SQL (TSQL) has the TOP clause to meet your needs. In this article Greg Larsen explores how to select a subset of data from a record set.

2015-04-16

9,580 reads

Blogs

Redgate Summit Comes to the Windy City

By

I love Chicago. I went to visit three times in 2023: a Redgate event,...

Non-Functional Requirements

By

I have found that non-functional requirements (NFRs) can be hard to define for a...

Techorama 2024 – Slides

By

You can find the slidedeck for my Techorama session “Microsoft Fabric for Dummies” on...

Read the latest Blogs

Forums

AG listener cant be removed

By ysalem

Testing with AG on Linux with Cluster=NONE. it was all going ok and as...

Remove comma inside Comma Delimited File csv in SSIS Using Script task

By hongho2

Hi, I have two tables: one for headers with 9 fields and another for...

Inserting 100K rows Performance - Baseline Performance

By MichaelT

We're trying to understand how quick new versions of SQL server can be.  Obviously...

Visit the forum

Question of the Day

The "ORDER BY" clause behavior

Let’s consider the following script that can be executed without any error on both SQL Sever and PostgreSQL. We define the table t1 in which we insert three records:

create table t1 (id int primary key, city varchar(50));

insert into t1 values (1, 'Rome'), (2, 'New York'), (3, NULL);
If we execute the following query, how will the records be sorted in both environments?
select city

from t1

order by city;

See possible answers