0
I have the field "killed" and "died" in the table, I need to make the order of the results come as the decrease of these two values, Example:
My query is like this:
$woes = DB::table('woeplayerrank as woe')
->join('char', 'woe.char_id', '=', 'char.char_id')
->select('woe.kills_permanente', 'woe.deaths_permanente', 'woe.killen_spree', 'woe.name', 'char.unban_time', 'char.class')
->orderBy('woe.kills_permanente', 'ansi')
->take('100');
I wish it was something around that:
$woes = DB::table('woeplayerrank as woe')
->join('char', 'woe.char_id', '=', 'char.char_id')
->select('woe.kills_permanente', 'woe.deaths_permanente', 'woe.killen_spree', 'woe.name', 'char.unban_time', 'char.class')
->orderByRaw('woe.kills_permanente - woe.deaths_permanente ansi)
->take('100');
Can anyone tell me how to do that?
Sorry my inexperience, but after a few attempts I could not make your solution run ! would have some alternative means?
– Lincoln Binda