How to show latest date data?

Asked

Viewed 109 times

3

I have a Tabela1:

  • ID Auto_increment;
  • varchar;
  • date;

I would like to show only the data with the latest date. How do I?

2 answers

5


Try to do:

SELECT * FROM tabela1 WHERE data = (SELECT data FROM tabela1 ORDER BY data DESC LIMIT 1);

2

You can do it all in a single select:

SELECT * FROM tabela1 ORDER BY data DESC LIMIT 1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.