Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Selecting bottom 10

Author  Topic 

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2010-04-21 : 04:28:40
Is there a way to select bottom 10 records from a table

just like you can select top 10 * from table

Kind Regards

Rob

MCTS certified

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-04-21 : 04:32:45
just add a ORDER BY clause

ORDER BY somecol ASC

or

ORDER BY somecol DESC

depending on your definition of what is TOP and what is BOTTOM


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-04-21 : 04:33:27
select top 10 * from table
means not that there is a reliable, reproducible result unless you specify an order by clause.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-21 : 05:41:38
quote:
Originally posted by masterdineen

Is there a way to select bottom 10 records from a table

just like you can select top 10 * from table

Kind Regards

Rob

MCTS certified


bottom top etc makes sense only when you specify in terms of a field. so question is on what basis you want bottom 10. posting some data sample will help

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -