> What is the best method for reading ONLY the last five records in a
> database for display?
>
> I have a client that adds articles daily to a news database, and then
> displays them on a news page. There are hundreds of articles, and on his
> home page he just wants to display the 5 most recent. (which would be
> the last five in the database, I presume....)
>
> Suggetstions???
Off the top of my head, why not invert the list with an Order By and select
the Top 5 - they'd be in the wrong order when they come out, but with a
sub-select, you can sort them however you want...
select *
from myTable
where ID in (select top 5 ID from myTable order by ID desc)
order by ID
HTH
Philip Arnold
ASP Multimedia Limited
T: +44 (0)20 8680 1133
"Websites for the real world"
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.