druid sql

I need bellow sql query in druid

SELCT MAX(tagvalue), time from datasource GROUP BY INTERVAL

I have also same problem.

select max(value), time from datasource group by TIME_FLOOR(__time TO SECOND)

but it is asking me put “time” also in group by which is standard way. But if i want to get max value and corresponding exact time value not interval time then i am not getting.