List:General Discussion« Previous MessageNext Message »
From:Thimble Smith Date:August 19 1999 10:58pm
Subject:Re: SELECT last row of table
View as plain text  
At 15:56, 19990819, Z Mehta wrote:
>Does anyone know how I can select the last row in the table?
>Something like this:
>SELECT * FROM submission WHERE Qno=lastrow ;

What do you mean "last row in the table"?  Tables are sets - they
don't have any order, unless you impose it.  So picking the last
row is meaningless.  If you want the row that was most recently
updated, then you should use a TIMESTAMP column, and do this:

SELECT * FROM submission ORDER BY timestamp_column DESC LIMIT 1;

There are other ways to do it.

SELECT last row of tableZ Mehta20 Aug
  • Re: SELECT last row of tablejeremy brand20 Aug
  • Re: SELECT last row of tableThimble Smith20 Aug
RE: SELECT last row of tableDarren L Sweeney20 Aug
Re: SELECT last row of tableDave Kaufman20 Aug