April 3, 2006 at 6:06 am
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
April 3, 2006 at 6:47 am
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.
April 3, 2006 at 6:57 am
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
April 3, 2006 at 7:02 am
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 !!!**
April 3, 2006 at 7:13 am
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