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:36 am
select top 5 nameid, nametitle from tblName
order by nameid desc
**ASCII stupid question, get a stupid ANSI !!!**
April 3, 2006 at 6:50 am
Hi Sushila,
You might misunderstood my query....
I wanted last five records that means if i have 50 records then i want records like 45,46,47,48,49 and 50th.
Can you please check it out and waiting for reply.
Thanks
Sanket
Regards
April 3, 2006 at 6:55 am
You mean something like this...?!?!
select a.* from
(select top 5 nameid, nametitle from tblName
order by nameid desc)a
order by a.nameid
**ASCII stupid question, get a stupid ANSI !!!**
April 3, 2006 at 7:01 am
Yes it worked for me....
Thanks
Sanket
Regards
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply