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 !!
Tech_MenAsked:
Who is Participating?
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.