mercredi 28 juin 2017

How would I retrieve the second result with query builder?

I am trying to retrieve the second result of this query (which works successfully):

$assist_stats = App\Stat::whereRaw('assists = (select max(`assists`) from stats)')->get()->first();

With this modified code:

$assist_stats2 = App\Stat::whereRaw('assists = (select max(`assists`) from stats)')->get([1]);

But I get this error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column '1' in 'field list' (SQL: select `1` from `stats` where assists = (select max(`assists`) from stats))

How would I retrieve the second result from the query?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2siRK58
via IFTTT

Aucun commentaire:

Enregistrer un commentaire