Good day.
It’s impossible to select the maximum column from the database, I’m doing this:
Cursor cursor = sqliteDB.query(Groups.TABLE_NAME, new String[]{"MAX("+Groups.GroupsColumns.MAX+")"}, null, null, null, null, null); tried and so
Cursor cursor = sqliteDB.rawQuery("SELECT MAX( "+Groups.GroupsColumns.MAX+" ) FROM "+ Groups.TABLE_NAME, null); there is data in the cursor
if (cursor.moveToFirst()) { max = cursor.getInt(cursor.getColumnIndexOrThrow(Groups.GroupsColumns.MAX)); Log.d("log", "max " + max); } but when I try to get them I get
column 'max' does not exist the base exists, such a column in it precisely exists, data is normally written to it, read normally, tried for the sake of interest with other columns - the same picture.
Thank you in advance.
it turns out that the entry with the column name 'MAX (max)' is written to the cursor until the solution is found
Groups.GroupsColumns.MAXwhat does it matter? - Yura Ivanovcursor.getColumnIndexOrThrow(Groups.GroupsColumns.MAX)the column name will be MAX (max). - Yura Ivanov