SSIS and Sql Server Journey

Personal Notes of Sarabjit Singh and Bhavpreet Singh

Top with ties and without ties

on March 17, 2013

Image

Top clause with ties

--with ties
Select top(4) with ties * from test.dbo.emp order by salary

– Query will generate rows including additional rows that have the same value based on the SORT column \columns as the last returned rows

– Can only be used in SELECT Statement and if and only if there is an ORDER BY clause specified.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: