Sunday, March 17, 2013

Top with ties and without ties

Image

Top clause with ties

[code language="sql"]--with ties
Select top(4) with ties * from test.dbo.emp order by salary[/code]

- 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.

No comments: