• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 192
  • Last Modified:

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

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 !!
0
Tech_Men
Asked:
Tech_Men
1 Solution
 
devsolnsCommented:
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.

-gp
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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now