Select Max, Min, Avg function?
How can I select something like this
SELECT max(salary) FROM COMPANY;
currently i have used
Cursor cursor = new Select().method("MAX","salary").from(company.class).query();
Yeah I mean I could have added more functions, just at some point it may be a lot. so I added the method() method to easily enable other functions.
@agrosner Sorry to ask you again. how do I get the Max value?
public static int foo() { Cursor cursor = new Select().method("MAX", Ticket$Table.TICKETID).from(Ticket.class).query(); if (cursor != null && cursor.getCount() > 0) { int ticketId = cursor.getInt(0); return ticketId + 1; } return 10000; }
this is my code but how do I get Max column?
int ticketId = cursor.getInt(0); is wrong
was this feature removed? can't find method function anymore.
Same, can't find that method funcion too