Thursday, October 16, 2008

How to get the last row of a table

To get the last row of a table we need to run the below query.

With Table Column:

SELECT * FROM table_name WHERE column_name =
(
SELECT max(column_name)
FROM table_name );

Without using table column:

select * from table_name where rowid=(select max(rowid) from table_name);

No comments:

Post a Comment