Display last 5 records from a table

  • Hi,

    I have one table named "tblName" it has only two fileds like "nameid" and "NameTitle". Table contains 50 records. now my problem is that I want to display last 5 records from tblName so what is required query for this, can anyone help me out

    Thanks

    Sanket

    Regards

  • follow thread here







    **ASCII stupid question, get a stupid ANSI !!!**

  • Hi,

    Use this Query :

    select * from authors order by 1

    select * from  (select top 5 * from authors order by au_id desc) a

    order by 1

    Regards,

    Amit Gupta.

     

  • Thanks Amit...

    That worked for me...

    Actually only single query is needed here.

    select * from  (select top 5 * from authors order by au_id desc) a

    order by 1

    what do you say?

    Thanks

    Sanket

    Regards

  • Sanket - as a favour to everybody (and yourself)...next time please do not cross-post - it is too time-consuming to respond to a post only to find that others have addressed it in other threads...







    **ASCII stupid question, get a stupid ANSI !!!**

  • Yes, thats true, but actually when I posted first time, bymistaken I pushed it submitted twice and luckily I got response from both threads and that is why whole senario is !!!

    Anyways I will take care nextime

    Thanks

    Sanket

    Regards

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply