mercredi 10 octobre 2018

Laravel 5.6: how to create a subquery using Query Builder

I would like to reproduce following mySQL query using Laravel query builder:

*SELECT SUM(scores) FROM (SELECT scores FROM player_games WHERE player_id = 1 ORDER BY id DESC LIMIT 2) scores

Any suggestions?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire