There is a table from which you need to pull out the maximum number (3rd column), sorting out 1 and 2 columns. That is, column 1 and 2 is set (there may be many such records), but it is necessary precisely in which the number in the 3rd column is maximum or minimum.
cursor = database.query(TABLE_NAME_WEATHER, new String[]{CELSIUS, FAHRENHEIT}, MONTH + " = ?" + " AND " + DAYOFMONTH + " = ?" + " AND " + CELSIUS + " = MAX(" + CELSIUS + ")", new String[]{month, date}, null, null, null); But an error pops up in this sample.
android.database.sqlite.SQLiteException: misuse of aggregate function MAX() (code 1): , while compiling: SELECT celsius, fahrenheit FROM weatherTable WHERE month = ? AND dayofmonth = ? AND celsius = MAX(celsius)