Recover the highest value in a column according to the repetition of the second

Asked

Viewed 48 times

0

Good night to you all!

I have a system in my company that records an entire value in a table every moment of the day. It also records the date and time in Datetime format;

The table in the bank is as follows:

inserir a descrição da imagem aqui

As you can see in the date column it repeats the date. I need to perform a query in that Mysql database where return the largest amount per day. In this case the above query would have to return as follows:

inserir a descrição da imagem aqui

Thank you for your attention!

Database: Mysql 5

  • If you have helped remember to mark as a response.

1 answer

2


Try to use it as follows:

SELECT MAX(QTD), DATA FROM TABELA GROUP BY DATA
  • Thank you very much Gustavo! That’s exactly what I needed. You can’t imagine how much you’ve helped me rsrs Thank you again

Browser other questions tagged

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