how to get last row of the database table.or only latest row entered in table
-
how to get last row of the database table.or only latest row entered in table
-
how to get last row of the database table.or only latest row entered in table
Depends a little bit on the database. If it is a SQL Server try this:
SELECT TOP(1) * FROM table ORDER BY field DESC
By providing a orderby clause you can specify what the condition behind "the last" record is. If you are interested in the last record that was added, you may use a timestamp or auto incremented field in the orderby clause. -
Depends a little bit on the database. If it is a SQL Server try this:
SELECT TOP(1) * FROM table ORDER BY field DESC
By providing a orderby clause you can specify what the condition behind "the last" record is. If you are interested in the last record that was added, you may use a timestamp or auto incremented field in the orderby clause.thnx for reply its working.....