Does the table have an autonumber (id) column? if so you could perform 
a query like
 
Select top 10 * from sometable
Where field1 = 'something'
Order by ID DESC
 
 
this will select the records you need, then order them by the autonumber field in 
descending order, then return back the top 10 rows, or in your case the last 10 rows.
 
hope this helps

George Oakes
VB.Net Programmer/Analyst 
Morgan Tire & Auto
dba. Tires Plus, Total Car Care 
(727) 442-8388 ext. 2374 
(800) 269-4424 Toll Free 
[EMAIL PROTECTED]

-----Original Message-----
From: Mischa Kroon [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 15, 2004 5:39 AM
To: [EMAIL PROTECTED]
Subject: RE: [AspNetAnyQuestionIsOk] Query Return Last 10 Records


If database = sql server:

Select top 10 from table order by id desc 

If is also possible to limit the nr of records returned trough ADO.NET which
is possible for all databases but this solution is a lot less efficient as
the one listed above. 


-----Original Message-----
From: shahid bashir [mailto:[EMAIL PROTECTED] 
Sent: woensdag 15 september 2004 11:35
To: [EMAIL PROTECTED]
Subject: [AspNetAnyQuestionIsOk] Query Return Last 10 Records



Dears I have table of items with 500 records I want to
my query will return only last 10 records 
but its also possible that I apply a condition due to
it requery return 100 records but i want only last 10
records 
thanks
Shahid Bashir



            
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com




Yahoo! Groups Links









Yahoo! Groups Sponsor   

ADVERTISEMENT
 
<http://us.ard.yahoo.com/SIG=129qh8n21/M=295196.4901138.6071305.3001176/D=groups/S=1705006764:HM/EXP=1095327586/A=2128215/R=0/SIG=10se96mf6/*http://companion.yahoo.com>
 click here    
  
<http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=:HM/A=2128215/rand=332369942>
     


  _____  

Yahoo! Groups Links


*       To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
  

*       To unsubscribe from this group, send an email to:
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
  

*       Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service 
<http://docs.yahoo.com/info/terms/> . 




[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to