Please, I need the SQL statement/keyword used to Retrieve the Last 'N' records from a table in the Database; just as we have TOP 'N' for the First N-records in a table.
For example, ("Select TOP 'N' * From Particulars Order by Phone DESC", conn)
where N is the number of records to be retrieved.
I use both SQL Server 2005 and Microsoft Access.
Thanks.
Quote:
Originally Posted by Temidayo
Hello House,
Please, I need the SQL statement/keyword used to Retrieve the Last 'N' records from a table in the Database; just as we have TOP 'N' for the First N-records in a table.
For example, ("Select TOP 'N' * From Particulars Order by Phone DESC", conn)
where N is the number of records to be retrieved.
I use both SQL Server 2005 and Microsoft Access.
Thanks.
create an identity column on your table...select your table, ORDER BY (that identity column) DESC...the first record will be the last record inserted on your table
No comments:
Post a Comment