TOP WITH TIES clause in SELECT queries [Tip/Trick]
Posted: 23 Nov 2009
Updated: 23 Nov 2009
Rating: 4.33/5
Votes: 2
Popularity: 1.30
Licence: The Code Project Open License (CPOL)
Bookmarked: 8
Downloaded: 0
The SELECT TOP N query always returns exactly N records, and randomly drops any record that have the same value as the last record in the group.SELECT TOP 5 price, Booktitle FROM BookTitles ORDER BY price DESCThis query will give 5 records from table BookTitles in descending order by price. ProblemS