2
I have in the Sqlite
a field called date_start
, which saves the date of a walk.
This one, it’s like Long
and keeps the date on milisegundos
.
I would like, through a query, to return the highest value (the last recorded walk).
For that I tried the following:
Cursor cursor = dataBase.query(table, properties, "MAX(date_start)", null,null, null, null, null);
But the following error occurs:
android.database.sqlite.Sqliteexception: misuse of Aggregate Function MAX() (code 1)
How do I get the highest value of this field?
In my case, because it is a long use: cursor.getLong(0)
– Thiago Luiz Domacoski