I have in the database table the index field. In it, when adding a row to a table, I write the date using the mktime() function. Is it possible to make a SELECT from a table, only that row, which has the largest index among all rows, that is, the one added later than all? And if so, how?

  • one
    Does mysql have such a thing as sorting ORDER ... just sort descending ORDER DESC and take the highest entry LIMIT 1 - Alexey Shimansky

1 answer 1

MSSQL

 Select Top(1) * From [Table] Order by [index] desc 

MySql

 Select * From [Table] Order by [index] desc LIMIT 1