how can i get the last 10 rows from my db ?

Posted on 2006-04-30
Last Modified: 2010-04-16
hi ,
i am working whit sql in winApp C# dot net
i want to get only the 10 news order from my db
how can i do it ?

thanks !!
Question by:Tech_Men
    1 Comment
    LVL 13

    Accepted Solution

    it depends on how you have the columns setup but regardless the top keyword will be of benefit to you.

    select top 10 *
    from tbl_orders
    order by order_date desc

    its just an example but the top keyword limits the number of rows returned.  returning the most recent depends on what columns you have to work with.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now