Data points outside time range -

I have inserted a table with this mysql query:

SELECT
  distinct(date(data)) AS "time",
  max(producao_ton) AS "producao_ton"
FROM operacao_br
WHERE
  $__timeFilter(data)
group by date(data)


But when i select a period that is less than 24h they show me this message, but gives me the right value. So is possible to disable the message, or solve it?

What are you trying to do with your group by? Have you seen the timeGroup macros that help you to group by time (5m or 1h): https://grafana.com/docs/features/datasources/mysql/#macros

To solve this probem:
https://localhost:3000/t/sum-the-max-value-of-every-day-in-grafana/16522
I used this query. Is there another way to do it?
I used this group by because i need only the max value of the day, then i used group by date.

Ok - thanks for the link, that explained it.

You have grouped per day and if you choose a period that is less than that then Grafana is going to complain. Nothing wrong with your query but you can make it more dynamic if you want. Using the $__timeGroup macro and a template variable you could choose the group by time from a dropdown:

$__timeGroup(createdAt,'$summarize') as "time",