Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL server

Posted on 2007-12-03
4
Medium Priority
?
206 Views
Last Modified: 2010-03-19
How do I select the BOTTOM x number from a list?

Selet top works...not bottom
0
Comment
Question by:lrbrister
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 29

Accepted Solution

by:
QPR earned 2000 total points
ID: 20399674
select the top but order by something desc

select top 50 *
from mytable
order by idnumber desc
0
 

Author Comment

by:lrbrister
ID: 20400077
QPR:
Doesn't taht still give me the top 50 of x million but inn descending order?
0
 
LVL 25

Expert Comment

by:imitchie
ID: 20400193
lrbrister:
that will select the TOP 50 from the BOTTOM upwards... i.e. BOTTOM 50
0
 
LVL 29

Expert Comment

by:QPR
ID: 20400314
nope because you are asking for the id (or some other sequential value) in descending order you will get the bottom 50
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question