How to get a query sorted by a formula of two columns in dbflow library?

143 Views Asked by At

I am working with dbflow library and I have a "Player" table that has two columns "wins" and "losses". I want to get all of "Player" rows sorting by (wins*3-losses) in descending order. I have tried this:

playerList = SQLite.select().from(Player.class).orderBy(Player_Table.x01Wins.times(3).minus(Player_Table.x01Losses), false).queryList();

But it has an error. How can I do this?

0

There are 0 best solutions below