Perhaps a:

SELECT TOP 3 PrimaryKey FROM YourTable
ORDER BY PrimaryKey DESC

(Access/MS SQL only I think.. pretty ignorant of the Oracle quirks)


> Use your order by descending:
>
> Select * from table_name order by primary_key DESC
>
> HTH
> Hatton
>
> -----Original Message-----
> From: Michael Wilson [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 14, 2001 12:59 AM
> To: CF-Talk
> Subject: getting last 3 records...
>
>
> Hi,
>
> I need to get the last 3 (newest) records entered into my table. I know
how
> to get the absolute lat record and I know how to get a specific set of
rows
> with startrow and maxrows, but I am having trouble getting the last _3_
> records. Any advice will be much appreciated.
>
> Mike
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to