I have Sqlite
a field called date_start
, which keeps the date of a walk.
This is of type Long
and stores the date in milisegundos
.
I would like, through a query, to return the highest value (the last recorded hike).
For this I have 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 in this field?